openMSX
Public Member Functions | List of all members
openmsx::BitmapConverter< Pixel > Class Template Reference

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

#include <BitmapConverter.hh>

Public Member Functions

 BitmapConverter (const Pixel *palette16, const Pixel *palette256, const Pixel *palette32768)
 Create a new bitmap scanline converter. More...
 
void convertLine (Pixel *linePtr, const byte *vramPtr)
 Convert a line of V9938 VRAM to 512 host pixels. More...
 
void convertLinePlanar (Pixel *linePtr, const byte *vramPtr0, const byte *vramPtr1)
 Convert a line of V9938 VRAM to 512 host pixels. More...
 
void setDisplayMode (DisplayMode mode_)
 Select the display mode to use for scanline conversion. More...
 
void palette16Changed ()
 Inform this class about changes in the palette16 array. More...
 

Detailed Description

template<class Pixel>
class openmsx::BitmapConverter< Pixel >

Utility class for converting VRAM contents to host pixels.

Definition at line 17 of file BitmapConverter.hh.

Constructor & Destructor Documentation

◆ BitmapConverter()

template<class Pixel >
openmsx::BitmapConverter< Pixel >::BitmapConverter ( const Pixel palette16,
const Pixel palette256,
const Pixel palette32768 
)

Create a new bitmap scanline converter.

Parameters
palette16Pointer to 2*16-entries array that specifies VDP color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine. Though to allow some internal optimizations, this class should be informed about changes in this array (not needed for the next two), see palette16Changed(). Used for display modes Graphic4, Graphic5 and Graphic6. First 16 entries are for even pixels, next 16 are for odd pixels
palette256Pointer to 256-entries array that specifies VDP color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine. Used for display mode Graphic7.
palette32768Pointer to 32768-entries array that specifies VDP color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine. Used when YJK filter is active.

Definition at line 12 of file BitmapConverter.cc.

Member Function Documentation

◆ convertLine()

template<class Pixel >
void openmsx::BitmapConverter< Pixel >::convertLine ( Pixel linePtr,
const byte vramPtr 
)

Convert a line of V9938 VRAM to 512 host pixels.

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

Parameters
linePtrPointer to array of host pixels.
vramPtrPointer to VRAM contents.

Definition at line 40 of file BitmapConverter.cc.

References openmsx::DisplayMode::getByte(), openmsx::DisplayMode::GRAPHIC4, openmsx::DisplayMode::GRAPHIC5, openmsx::DisplayMode::GRAPHIC6, openmsx::DisplayMode::GRAPHIC7, UNREACHABLE, openmsx::DisplayMode::YAE, and openmsx::DisplayMode::YJK.

◆ convertLinePlanar()

template<class Pixel >
void openmsx::BitmapConverter< Pixel >::convertLinePlanar ( Pixel linePtr,
const byte vramPtr0,
const byte vramPtr1 
)

Convert a line of V9938 VRAM to 512 host pixels.

Call this method in planar display modes (Graphic6 and Graphic7).

Parameters
linePtrPointer to array of host pixels.
vramPtr0Pointer to VRAM contents, first plane.
vramPtr1Pointer to VRAM contents, second plane.

Definition at line 74 of file BitmapConverter.cc.

References detail::data(), g, openmsx::DisplayMode::getByte(), openmsx::DisplayMode::GRAPHIC4, openmsx::DisplayMode::GRAPHIC5, openmsx::DisplayMode::GRAPHIC6, openmsx::DisplayMode::GRAPHIC7, unlikely, UNREACHABLE, openmsx::DisplayMode::YAE, and openmsx::DisplayMode::YJK.

◆ palette16Changed()

template<class Pixel>
void openmsx::BitmapConverter< Pixel >::palette16Changed ( )
inline

Inform this class about changes in the palette16 array.

Definition at line 71 of file BitmapConverter.hh.

◆ setDisplayMode()

template<class Pixel>
void openmsx::BitmapConverter< Pixel >::setDisplayMode ( DisplayMode  mode_)
inline

Select the display mode to use for scanline conversion.

Parameters
mode_The new display mode.

Definition at line 64 of file BitmapConverter.hh.


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