18 constexpr explicit DisplayMode(
byte mode_) : mode(mode_) {}
27 static constexpr uint8_t
TEXT1 = 0x01;
30 static constexpr uint8_t
TEXT1Q = 0x05;
31 static constexpr uint8_t
MULTIQ = 0x06;
33 static constexpr uint8_t
TEXT2 = 0x09;
49 static constexpr byte YJK = 0x20;
52 static constexpr byte YAE = 0x40;
65 if ((reg25 & 0x08) == 0) reg25 = 0;
67 ((reg25 & 0x18) << 2) |
68 ((reg0 & 0x0E) << 1) |
69 ((reg1 & 0x08) >> 2) |
70 ((reg1 & 0x10) >> 4));
74 if ((reg25 & 0x08) == 0) reg25 = 0;
92 [[nodiscard]]
constexpr byte getByte()
const {
106 [[nodiscard]]
constexpr byte getBase()
const {
114 return (mode & 0x18) != 0;
141 return (mode & 0x14) == 0x14;
162 return isMSX1 ? 1 : 0;
Represents a VDP display mode.
constexpr bool isSpriteNarrow() const
Are sprite pixels narrow?
constexpr DisplayMode updateReg25(byte reg25) const
constexpr byte getBase() const
Get the base display mode as an integer: M5..M1 combined.
constexpr void setByte(byte mode_)
Used for de-serialization.
static constexpr uint8_t GRAPHIC3
static constexpr uint8_t MULTIQ
static constexpr uint8_t MULTICOLOR
static constexpr uint8_t TEXT1Q
static constexpr uint8_t GRAPHIC4
constexpr bool isPlanar() const
Is VRAM "planar" in the current display mode? Graphic 6 and 7 spread their bytes over two VRAM ICs,...
static constexpr uint8_t GRAPHIC5
static constexpr uint8_t GRAPHIC1
constexpr unsigned getLineWidth() const
Get number of pixels on a display line in this mode.
static constexpr uint8_t GRAPHIC7
constexpr bool operator==(const DisplayMode &) const =default
Equals operator.
static constexpr uint8_t TEXT2
constexpr bool isBitmapMode() const
Is the current mode a bitmap mode? Graphic4 and higher are bitmap modes.
constexpr DisplayMode()=default
Create the initial display mode.
static constexpr byte REG25_MASK
Bits of VDP register 25 that encode part of the display mode.
constexpr bool isV9938Mode() const
Was this mode introduced by the V9938?
static constexpr byte YAE
Encoding of YAE flag.
constexpr DisplayMode(byte reg0, byte reg1, byte reg25)
Create a specific display mode.
static constexpr uint8_t GRAPHIC6
constexpr void reset()
Bring the display mode to its initial state.
static constexpr byte REG1_MASK
Bits of VDP register 1 that encode part of the display mode.
constexpr bool isTextMode() const
Is the current mode a text mode? Text1 and Text2 are text modes.
static constexpr byte YJK
Encoding of YJK flag.
static constexpr uint8_t GRAPHIC2
constexpr byte getByte() const
Get the display mode as a byte: YAE YJK M5..M1 combined.
static constexpr uint8_t TEXT1
constexpr int getSpriteMode(bool isMSX1) const
Get the sprite mode of this display mode.
static constexpr byte REG0_MASK
Bits of VDP register 0 that encode part of the display mode.
This file implemented 3 utility functions:
uint8_t byte
8 bit unsigned integer