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