14 , debuggable(getMotherBoard(),
getName())
15 , firmwareSwitch(config)
17 reset(EmuTime::dummy());
33 switch (port & 0x01) {
35 return registerSelect;
37 return readRegister(registerSelect);
46 switch (port & 0x01) {
48 registerSelect = value;
51 writeRegister(registerSelect, value);
58byte MSXS1990::readRegister(
byte reg)
const
62 return firmwareSwitch.
getStatus() ? 0x40 : 0x00;
76void MSXS1990::writeRegister(
byte reg,
byte value)
85void MSXS1990::setCPUStatus(
byte value)
87 cpuStatus = value & 0x60;
90 bool dram = (cpuStatus & 0x40) == 0;
97MSXS1990::Debuggable::Debuggable(MSXMotherBoard& motherBoard_,
const std::string& name_)
98 : SimpleDebuggable(motherBoard_, name_ +
" regs",
"S1990 registers", 16)
102byte MSXS1990::Debuggable::read(
unsigned address)
105 return s1990.readRegister(narrow<byte>(address));
108void MSXS1990::Debuggable::write(
unsigned address,
byte value)
111 s1990.writeRegister(narrow<byte>(address), value);
115template<
typename Archive>
118 ar.template serializeBase<MSXDevice>(*
this);
119 ar.serialize(
"registerSelect", registerSelect,
120 "cpuStatus", cpuStatus);
121 if constexpr (Archive::IS_LOADER) {
122 setCPUStatus(cpuStatus);
void setActiveCPU(CPUType 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.
std::string getName(KeyCode keyCode)
Translate key code to key name.
This file implemented 3 utility functions:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define OUTER(type, member)
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)