18 constexpr explicit DisplayMode(
byte mode_) : mode(mode_) {}
51 static constexpr byte YJK = 0x20;
54 static constexpr byte YAE = 0x40;
67 if ((reg25 & 0x08) == 0) reg25 = 0;
69 ((reg25 & 0x18) << 2) |
70 ((reg0 & 0x0E) << 1) |
71 ((reg1 & 0x08) >> 2) |
72 ((reg1 & 0x10) >> 4));
76 if ((reg25 & 0x08) == 0) reg25 = 0;
94 [[nodiscard]]
constexpr byte getByte()
const {
108 [[nodiscard]]
constexpr byte getBase()
const {
116 return (mode & 0x18) != 0;
143 return (mode & 0x14) == 0x14;
164 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.
constexpr bool isPlanar() const
Is VRAM "planar" in the current display mode? Graphic 6 and 7 spread their bytes over two VRAM ICs,...
constexpr unsigned getLineWidth() const
Get number of pixels on a display line in this mode.
constexpr bool operator==(const DisplayMode &) const =default
Equals operator.
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.
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.
constexpr byte getByte() const
Get the display mode as a byte: YAE YJK M5..M1 combined.
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