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;
68 mode = ((reg25 & 0x18) << 2)
69 | ((reg0 & 0x0E) << 1)
70 | ((reg1 & 0x08) >> 2)
71 | ((reg1 & 0x10) >> 4);
75 if ((reg25 & 0x08) == 0) reg25 = 0;
88 return mode == otherMode.mode;
94 return mode != otherMode.mode;
101 [[nodiscard]] constexpr
byte getByte()
const {
115 [[nodiscard]] constexpr
byte getBase()
const {
123 return (mode & 0x18) != 0;
150 return (mode & 0x14) == 0x14;
171 return isMSX1 ? 1 : 0;
Represents a VDP display mode.
constexpr bool isSpriteNarrow() const
Are sprite pixels narrow?
constexpr bool operator==(const DisplayMode &otherMode) const
Equals operator.
constexpr DisplayMode updateReg25(byte reg25) const
constexpr byte getBase() const
Get the base dispay mode as an integer: M5..M1 combined.
constexpr void setByte(byte mode_)
Used for de-serialization.
constexpr bool operator!=(const DisplayMode &otherMode) const
Does-not-equal operator.
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 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 dispay 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: