14 , hasEnable(config.getChildDataAsBool(
"hasEnable", true))
16 reset(EmuTime::dummy());
24 if (refs.size() != 1) {
26 "need reference to VDP device.");
28 vdp =
dynamic_cast<VDP*
>(refs[0]);
30 throw MSXException(
"Invalid ADVRAM configuration: device '",
31 refs[0]->
getName(),
"' is not a VDP device.");
49 enabled = ((port & 0x8000) != 0);
50 planar = ((port & 0x4000) != 0);
52 planar = ((port & 0x0100) != 0);
60 baseAddr = (value & 0x07) << 14;
63 unsigned ADVram::calcAddress(
word address)
const
65 unsigned addr = (address & 0x3FFF) | baseAddr;
67 addr = ((addr & 1) << 16) | (addr >> 1);
74 return enabled ? vram->
cpuRead(calcAddress(address), time) : 0xFF;
80 vram->
cpuWrite(calcAddress(address), value, time);
84 template<
typename Archive>
87 ar.template serializeBase<MSXDevice>(*
this);
88 ar.serialize(
"baseAddr", baseAddr,
Implementation of direct cpu access to VRAM.
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte at a certain time to a given location in the video ram.
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port, set mapper register.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location in the video ram at a certain time.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port, change mode bits.
void reset(EmuTime::param time) override
This method is called on reset.
void serialize(Archive &ar, unsigned version)
ADVram(const DeviceConfig &config)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
virtual const std::string & getName() const
Returns a human-readable name for this device.
const Devices & getReferences() const
Get the device references that are specified for this device.
byte cpuRead(unsigned address, EmuTime::param time)
Read a byte from VRAM though the CPU interface.
unsigned getSize() const
Returns the size of VRAM in bytes.
void cpuWrite(unsigned address, byte value, EmuTime::param time)
Write a byte to VRAM through the CPU interface.
VDPVRAM & getVRAM()
Get the VRAM object for this VDP.
constexpr vecN< N, T > min(const vecN< N, T > &x, const vecN< N, T > &y)
This file implemented 3 utility functions:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)