openMSX
MSXHBI55.hh
Go to the documentation of this file.
1 #ifndef MSXHBI55_HH
2 #define MSXHBI55_HH
3 
4 #include "MSXDevice.hh"
5 #include "I8255Interface.hh"
6 #include "I8255.hh"
7 #include "SRAM.hh"
8 
9 namespace openmsx {
10 
11 class MSXHBI55 final : public MSXDevice, public I8255Interface
12 {
13 public:
14  explicit MSXHBI55(const DeviceConfig& config);
15 
16  void reset(EmuTime::param time) override;
17  byte readIO(word port, EmuTime::param time) override;
18  byte peekIO(word port, EmuTime::param time) const override;
19  void writeIO(word port, byte value, EmuTime::param time) override;
20 
21  template<typename Archive>
22  void serialize(Archive& ar, unsigned version);
23 
24 private:
25  // I8255Interface
26  byte readA(EmuTime::param time) override;
27  byte readB(EmuTime::param time) override;
28  nibble readC0(EmuTime::param time) override;
29  nibble readC1(EmuTime::param time) override;
30  byte peekA(EmuTime::param time) const override;
31  byte peekB(EmuTime::param time) const override;
32  nibble peekC0(EmuTime::param time) const override;
33  nibble peekC1(EmuTime::param time) const override;
34  void writeA(byte value, EmuTime::param time) override;
35  void writeB(byte value, EmuTime::param time) override;
36  void writeC0(nibble value, EmuTime::param time) override;
37  void writeC1(nibble value, EmuTime::param time) override;
38 
39  byte readSRAM(word address) const;
40 
41  I8255 i8255;
42  SRAM sram;
43  word readAddress;
44  word writeAddress;
45  byte addressLatch;
46  byte writeLatch;
47  byte mode;
48 };
49 
50 } // namespace openmsx
51 
52 #endif
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: MSXHBI55.cc:58
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXHBI55.cc:63
MSXHBI55(const DeviceConfig &config)
Definition: MSXHBI55.cc:40
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXHBI55.cc:48
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void serialize(Archive &ar, unsigned version)
Definition: MSXHBI55.cc:163
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
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: MSXHBI55.cc:68
uint8_t nibble
4 bit integer
Definition: openmsx.hh:23
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29