openMSX
|
Represents a VDP display mode. More...
#include <DisplayMode.hh>
Public Types | |
enum | { GRAPHIC1 = 0x00 , TEXT1 = 0x01 , MULTICOLOR = 0x02 , GRAPHIC2 = 0x04 , TEXT1Q = 0x05 , MULTIQ = 0x06 , GRAPHIC3 = 0x08 , TEXT2 = 0x09 , GRAPHIC4 = 0x0C , GRAPHIC5 = 0x10 , GRAPHIC6 = 0x14 , GRAPHIC7 = 0x1C } |
Public Member Functions | |
constexpr | DisplayMode ()=default |
Create the initial display mode. More... | |
constexpr | DisplayMode (byte reg0, byte reg1, byte reg25) |
Create a specific display mode. More... | |
constexpr DisplayMode | updateReg25 (byte reg25) const |
constexpr void | reset () |
Bring the display mode to its initial state. More... | |
constexpr bool | operator== (const DisplayMode &) const =default |
Equals operator. More... | |
constexpr byte | getByte () const |
Get the display mode as a byte: YAE YJK M5..M1 combined. More... | |
constexpr void | setByte (byte mode_) |
Used for de-serialization. More... | |
constexpr byte | getBase () const |
Get the base display mode as an integer: M5..M1 combined. More... | |
constexpr bool | isV9938Mode () const |
Was this mode introduced by the V9938? More... | |
constexpr bool | isTextMode () const |
Is the current mode a text mode? Text1 and Text2 are text modes. More... | |
constexpr bool | isBitmapMode () const |
Is the current mode a bitmap mode? Graphic4 and higher are bitmap modes. More... | |
constexpr bool | isPlanar () const |
Is VRAM "planar" in the current display mode? Graphic 6 and 7 spread their bytes over two VRAM ICs, such that the even bytes go to the first half of the address space and the odd bytes to the second half. More... | |
constexpr bool | isSpriteNarrow () const |
Are sprite pixels narrow? More... | |
constexpr int | getSpriteMode (bool isMSX1) const |
Get the sprite mode of this display mode. More... | |
constexpr unsigned | getLineWidth () const |
Get number of pixels on a display line in this mode. More... | |
Static Public Attributes | |
static constexpr byte | REG0_MASK = 0x0E |
Bits of VDP register 0 that encode part of the display mode. More... | |
static constexpr byte | REG1_MASK = 0x18 |
Bits of VDP register 1 that encode part of the display mode. More... | |
static constexpr byte | REG25_MASK = 0x18 |
Bits of VDP register 25 that encode part of the display mode. More... | |
static constexpr byte | YJK = 0x20 |
Encoding of YJK flag. More... | |
static constexpr byte | YAE = 0x40 |
Encoding of YAE flag. More... | |
Represents a VDP display mode.
A display mode determines how bytes in the VRAM are converted to pixel colors. A display mode consists of a base mode with YJK filters on top. Only the V9958 supports YJK filters.
Definition at line 15 of file DisplayMode.hh.
anonymous enum |
Enumerator | |
---|---|
GRAPHIC1 | |
TEXT1 | |
MULTICOLOR | |
GRAPHIC2 | |
TEXT1Q | |
MULTIQ | |
GRAPHIC3 | |
TEXT2 | |
GRAPHIC4 | |
GRAPHIC5 | |
GRAPHIC6 | |
GRAPHIC7 |
Definition at line 26 of file DisplayMode.hh.
|
constexprdefault |
Create the initial display mode.
Referenced by reset(), and updateReg25().
Create a specific display mode.
reg0 | The contents of VDP register 0. |
reg1 | The contents of VDP register 1. |
reg25 | The contents of VDP register 25; on non-V9958 chips, pass 0. |
Definition at line 66 of file DisplayMode.hh.
|
inlineconstexpr |
Get the base display mode as an integer: M5..M1 combined.
If YJK is active, the base mode is the underlying display mode.
Definition at line 108 of file DisplayMode.hh.
Referenced by getSpriteMode(), isBitmapMode(), isTextMode(), openmsx::ImGuiCharacter::paint(), openmsx::CharacterConverter::setDisplayMode(), openmsx::VDPCmdEngine::updateDisplayMode(), openmsx::PixelRenderer::updatePalette(), and updateReg25().
|
inlineconstexpr |
Get the display mode as a byte: YAE YJK M5..M1 combined.
Definition at line 94 of file DisplayMode.hh.
Referenced by openmsx::VDP::changeRegister(), openmsx::BitmapConverter::convertLine(), openmsx::BitmapConverter::convertLinePlanar(), openmsx::SDLRasterizer::drawSprites(), openmsx::VDP::getBackgroundColor(), openmsx::VDP::serialize(), openmsx::SDLRasterizer::setBackgroundColor(), openmsx::SDLRasterizer::setDisplayMode(), openmsx::PixelRenderer::updateDisplayMode(), and openmsx::PixelRenderer::updatePalette().
|
inlineconstexpr |
Get number of pixels on a display line in this mode.
Definition at line 181 of file DisplayMode.hh.
References GRAPHIC5, GRAPHIC6, and TEXT2.
Referenced by openmsx::SDLRasterizer::drawBorder(), openmsx::SDLRasterizer::drawDisplay(), and openmsx::SDLRasterizer::drawSprites().
|
inlineconstexpr |
Get the sprite mode of this display mode.
Definition at line 159 of file DisplayMode.hh.
References getBase(), GRAPHIC1, GRAPHIC2, GRAPHIC3, GRAPHIC4, GRAPHIC5, GRAPHIC6, GRAPHIC7, MULTICOLOR, MULTIQ, TEXT1, TEXT1Q, and TEXT2.
Referenced by openmsx::SDLRasterizer::drawSprites(), openmsx::VDP::spritesEnabled(), and openmsx::VDP::spritesEnabledFast().
|
inlineconstexpr |
Is the current mode a bitmap mode? Graphic4 and higher are bitmap modes.
Definition at line 131 of file DisplayMode.hh.
References getBase().
Referenced by openmsx::SDLRasterizer::drawDisplay(), and openmsx::SDLRasterizer::setDisplayMode().
|
inlineconstexpr |
Is VRAM "planar" in the current display mode? Graphic 6 and 7 spread their bytes over two VRAM ICs, such that the even bytes go to the first half of the address space and the odd bytes to the second half.
Definition at line 141 of file DisplayMode.hh.
Referenced by openmsx::SDLRasterizer::drawDisplay(), and openmsx::ImGuiSpriteViewer::paint().
|
inlineconstexpr |
|
inlineconstexpr |
Is the current mode a text mode? Text1 and Text2 are text modes.
Definition at line 123 of file DisplayMode.hh.
References getBase(), TEXT1, TEXT1Q, and TEXT2.
Referenced by openmsx::SDLRasterizer::drawDisplay(), openmsx::VDP::getLeftSprites(), openmsx::VDP::getRightBorder(), and openmsx::VDP::peekStatusReg().
|
inlineconstexpr |
Was this mode introduced by the V9938?
Definition at line 115 of file DisplayMode.hh.
|
constexprdefault |
Equals operator.
|
inlineconstexpr |
Bring the display mode to its initial state.
Definition at line 82 of file DisplayMode.hh.
References DisplayMode().
|
inlineconstexpr |
Used for de-serialization.
Definition at line 99 of file DisplayMode.hh.
Referenced by openmsx::VDP::serialize().
|
inlineconstexpr |
Definition at line 75 of file DisplayMode.hh.
References DisplayMode(), and getBase().
|
staticconstexpr |
Bits of VDP register 0 that encode part of the display mode.
Definition at line 42 of file DisplayMode.hh.
Referenced by openmsx::VDP::changeRegister().
|
staticconstexpr |
Bits of VDP register 1 that encode part of the display mode.
Definition at line 45 of file DisplayMode.hh.
Referenced by openmsx::VDP::changeRegister().
|
staticconstexpr |
Bits of VDP register 25 that encode part of the display mode.
Definition at line 48 of file DisplayMode.hh.
Referenced by openmsx::VDP::changeRegister().
|
staticconstexpr |
Encoding of YAE flag.
Definition at line 54 of file DisplayMode.hh.
Referenced by openmsx::BitmapConverter::convertLine(), openmsx::BitmapConverter::convertLinePlanar(), and openmsx::ImGuiBitmapViewer::paint().
|
staticconstexpr |
Encoding of YJK flag.
Definition at line 51 of file DisplayMode.hh.
Referenced by openmsx::BitmapConverter::convertLine(), openmsx::BitmapConverter::convertLinePlanar(), and openmsx::ImGuiBitmapViewer::paint().