16 for (
unsigned i = 0; i < 2; i++) {
19 ports[i]->write(0xFB, time);
33 byte joy2 = ports[1]->read(time) & 0x3F;
34 return 0xF0 | (joy2 >> 2);
36 byte joy1 = ports[0]->read(time) & 0x3F;
37 byte joy2 = ports[1]->read(time) & 0x3F;
38 return narrow_cast<byte>(joy1 | (joy2 << 6));
43template<
typename Archive>
46 ar.template serializeBase<MSXDevice>(*
this);
#define REGISTER_MSXDEVICE(CLASS, NAME)
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:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)