43 , i8255(*this, getCurrentTime(), config.getGlobalSettings().getInvalidPpiModeSetting())
44 , sram(
getName() +
" SRAM", 0x1000, config)
61 return i8255.
read(port & 0x03, time);
66 return i8255.
peek(port & 0x03, time);
71 i8255.
write(port & 0x03, value, time);
77 byte MSXHBI55::readA(EmuTime::param time)
81 byte MSXHBI55::peekA(EmuTime::param )
const
86 byte MSXHBI55::readB(EmuTime::param time)
90 byte MSXHBI55::peekB(EmuTime::param )
const
96 void MSXHBI55::writeA(
byte value, EmuTime::param )
100 void MSXHBI55::writeB(
byte value, EmuTime::param )
102 word address = addressLatch | ((value & 0x0F) << 8);
110 writeAddress = address;
113 sram.
write(writeAddress, writeLatch);
116 readAddress = address;
121 nibble MSXHBI55::readC0(EmuTime::param time)
125 nibble MSXHBI55::peekC0(EmuTime::param )
const
127 return readSRAM(readAddress) & 0x0F;
129 nibble MSXHBI55::readC1(EmuTime::param time)
133 nibble MSXHBI55::peekC1(EmuTime::param )
const
135 return readSRAM(readAddress) >> 4;
143 void MSXHBI55::writeC0(
nibble value, EmuTime::param )
145 writeLatch = (writeLatch & 0xF0) | value;
147 sram.
write(writeAddress, writeLatch);
150 void MSXHBI55::writeC1(
nibble value, EmuTime::param )
152 writeLatch = (writeLatch & 0x0F) | (value << 4);
154 sram.
write(writeAddress, writeLatch);
158 byte MSXHBI55::readSRAM(
word address)
const
160 return address ? sram[address] : 0x53;
163 template<
typename Archive>
166 ar.template serializeBase<MSXDevice>(*
this);
167 ar.serialize(
"i8255", i8255,
169 "readAddress", readAddress,
170 "writeAddress", writeAddress,
171 "addressLatch", addressLatch,
172 "writeLatch", writeLatch,
void reset(EmuTime::param time)
byte peek(byte port, EmuTime::param time) const
byte read(byte port, EmuTime::param time)
void write(byte port, byte value, EmuTime::param time)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
EmuTime::param getCurrentTime() const
void reset(EmuTime::param time) override
This method is called on reset.
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
void serialize(Archive &ar, unsigned version)
MSXHBI55(const DeviceConfig &config)
void write(unsigned addr, byte value)
string getName(KeyCode keyCode)
Translate key code to key name.
This file implemented 3 utility functions:
uint8_t nibble
4 bit integer
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)