openMSX
SVIPPI.hh
Go to the documentation of this file.
1 // This class implements the mapping of the PPI (8255) into the SVI machine.
2 
3 #ifndef SVIPPI_HH
4 #define SVIPPI_HH
5 
6 #include "MSXDevice.hh"
7 #include "I8255Interface.hh"
8 #include "I8255.hh"
9 #include "Keyboard.hh"
10 #include "KeyClick.hh"
11 
12 namespace openmsx {
13 
14 class CassettePortInterface;
15 class JoystickPortIf;
16 
17 class SVIPPI final : public MSXDevice, public I8255Interface
18 {
19 public:
20  SVIPPI(const DeviceConfig& config);
21 
22  void reset(EmuTime::param time) override;
23  byte readIO(word port, EmuTime::param time) override;
24  byte peekIO(word port, EmuTime::param time) const override;
25  void writeIO(word port, byte value, EmuTime::param time) override;
26 
27  template<typename Archive>
28  void serialize(Archive& ar, unsigned version);
29 
30 private:
31  // I8255Interface
32  byte readA(EmuTime::param time) override;
33  byte readB(EmuTime::param time) override;
34  nibble readC0(EmuTime::param time) override;
35  nibble readC1(EmuTime::param time) override;
36  byte peekA(EmuTime::param time) const override;
37  byte peekB(EmuTime::param time) const override;
38  nibble peekC0(EmuTime::param time) const override;
39  nibble peekC1(EmuTime::param time) const override;
40  void writeA(byte value, EmuTime::param time) override;
41  void writeB(byte value, EmuTime::param time) override;
42  void writeC0(nibble value, EmuTime::param time) override;
43  void writeC1(nibble value, EmuTime::param time) override;
44 
45  CassettePortInterface& cassettePort;
46  I8255 i8255;
47  KeyClick click;
48  Keyboard keyboard;
49  JoystickPortIf* ports[2];
50  nibble prevBits;
51  nibble selectedRow;
52 };
53 
54 } // namespace openmsx
55 
56 #endif
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.
Definition: SVIPPI.cc:110
void reset(EmuTime::param time) override
This method is called on reset.
Definition: SVIPPI.cc:94
SVIPPI(const DeviceConfig &config)
Definition: SVIPPI.cc:68
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: SVIPPI.cc:100
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void serialize(Archive &ar, unsigned version)
Definition: SVIPPI.cc:189
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: SVIPPI.cc:105
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
uint8_t nibble
4 bit integer
Definition: openmsx.hh:23
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29