15 for (
unsigned i = 0; i < 2; i++) {
18 ports[i]->
write(0xFB, time);
36 byte joy2 = ports[1]->
read(time) & 0x3F;
37 return 0xF0 | (joy2 >> 2);
39 byte joy1 = ports[0]->
read(time) & 0x3F;
40 byte joy2 = ports[1]->
read(time) & 0x3F;
41 return joy1 | (joy2 << 6);
46 template<
typename Archive>
49 ar.template serializeBase<MSXDevice>(*
this);
virtual void write(byte value, EmuTime::param time)=0
virtual byte read(EmuTime::param time)=0
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.
EmuTime::param getCurrentTime() const
JoystickPortIf & getJoystickPort(unsigned port)
I/O port access to the joysticks for the Sega SG-1000.
SG1000JoystickIO(const DeviceConfig &config)
void serialize(Archive &ar, unsigned version)
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:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)