openMSX
Public Types | Public Member Functions | List of all members
openmsx::CharacterConverter Class Reference

Utility class for converting VRAM contents to host pixels. More...

#include <CharacterConverter.hh>

Public Types

using Pixel = uint32_t
 

Public Member Functions

 CharacterConverter (VDP &vdp, std::span< const Pixel, 16 > palFg, std::span< const Pixel, 16 > palBg)
 Create a new bitmap scanline converter.
 
void convertLine (std::span< Pixel > buf, int line) const
 Convert a line of V9938 VRAM to 256 or 512 host pixels.
 
void setDisplayMode (DisplayMode mode)
 Select the display mode to use for scanline conversion.
 

Detailed Description

Utility class for converting VRAM contents to host pixels.

Definition at line 18 of file CharacterConverter.hh.

Member Typedef Documentation

◆ Pixel

Definition at line 21 of file CharacterConverter.hh.

Constructor & Destructor Documentation

◆ CharacterConverter()

openmsx::CharacterConverter::CharacterConverter ( VDP vdp,
std::span< const Pixel, 16 >  palFg,
std::span< const Pixel, 16 >  palBg 
)

Create a new bitmap scanline converter.

Parameters
vdpThe VDP of which the VRAM will be converted.
palFgPointer to 16-entries array that specifies VDP foreground color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine.
palBgPointer to 16-entries array that specifies VDP background color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine.

Definition at line 29 of file CharacterConverter.cc.

Member Function Documentation

◆ convertLine()

void openmsx::CharacterConverter::convertLine ( std::span< Pixel buf,
int  line 
) const

Convert a line of V9938 VRAM to 256 or 512 host pixels.

Call this method in non-planar display modes (Graphic4 and Graphic5).

Parameters
bufBuffer where host pixels will be written to. Depending on the screen mode, the buffer must contain at least 256 or 512 pixels, but more is allowed (the extra pixels aren't touched).
lineDisplay line number [0..255].

Definition at line 41 of file CharacterConverter.cc.

References openmsx::DisplayMode::GRAPHIC1, openmsx::DisplayMode::GRAPHIC2, openmsx::DisplayMode::GRAPHIC3, openmsx::VDP::isMSX1VDP(), openmsx::DisplayMode::MULTICOLOR, openmsx::DisplayMode::MULTIQ, openmsx::DisplayMode::TEXT1, openmsx::DisplayMode::TEXT1Q, and openmsx::DisplayMode::TEXT2.

Referenced by openmsx::SDLRasterizer::drawDisplay().

◆ setDisplayMode()

void openmsx::CharacterConverter::setDisplayMode ( DisplayMode  mode)

Select the display mode to use for scanline conversion.

Parameters
modeThe new display mode.

Definition at line 35 of file CharacterConverter.cc.

References openmsx::DisplayMode::getBase().

Referenced by openmsx::SDLRasterizer::setDisplayMode().


The documentation for this class was generated from the following files: