14 , debuggable(getMotherBoard(), getName())
15 , firmwareSwitch(config)
17 reset(EmuTime::dummy());
33 switch (port & 0x01) {
35 return registerSelect;
37 return readRegister(registerSelect);
45 switch (port & 0x01) {
47 registerSelect = value;
50 writeRegister(registerSelect, value);
57byte MSXS1990::readRegister(
byte reg)
const
61 return firmwareSwitch.
getStatus() ? 0x40 : 0x00;
75void MSXS1990::writeRegister(
byte reg,
byte value)
84void MSXS1990::setCPUStatus(
byte value)
86 cpuStatus = value & 0x60;
89 bool dram = (cpuStatus & 0x40) == 0;
97 : SimpleDebuggable(motherBoard_, name_ +
" regs",
"S1990 registers", 16)
101byte MSXS1990::Debuggable::read(
unsigned address)
103 const auto& s1990 =
OUTER(MSXS1990, debuggable);
104 return s1990.readRegister(narrow<byte>(address));
107void MSXS1990::Debuggable::write(
unsigned address,
byte value)
109 auto& s1990 =
OUTER(MSXS1990, debuggable);
110 s1990.writeRegister(narrow<byte>(address), value);
114template<
typename Archive>
117 ar.template serializeBase<MSXDevice>(*
this);
118 ar.serialize(
"registerSelect", registerSelect,
119 "cpuStatus", cpuStatus);
120 if constexpr (Archive::IS_LOADER) {
121 setCPUStatus(cpuStatus);
#define REGISTER_MSXDEVICE(CLASS, NAME)
void setActiveCPU(Type cpu)
Switch between Z80/R800.
void setDRAMmode(bool dram)
Sets DRAM or ROM mode (influences memory access speed for R800).
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
MSXMotherBoard & getMotherBoard() const
Get the mother board this device belongs to.
PanasonicMemory & getPanasonicMemory()
This class implements the MSX-engine found in a MSX Turbo-R (S1990)
void serialize(Archive &ar, unsigned version)
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.
MSXS1990(const DeviceConfig &config)
void reset(EmuTime::param time) override
This method is called on reset.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define OUTER(type, member)
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)