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  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
18  [[nodiscard]] 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  [[nodiscard]] byte readA(EmuTime::param time) override;
27  [[nodiscard]] byte readB(EmuTime::param time) override;
28  [[nodiscard]] nibble readC0(EmuTime::param time) override;
29  [[nodiscard]] nibble readC1(EmuTime::param time) override;
30  [[nodiscard]] byte peekA(EmuTime::param time) const override;
31  [[nodiscard]] byte peekB(EmuTime::param time) const override;
32  [[nodiscard]] nibble peekC0(EmuTime::param time) const override;
33  [[nodiscard]] 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  [[nodiscard]] byte readSRAM(word address) const;
40 
41 private:
42  I8255 i8255;
43  SRAM sram;
44  word readAddress;
45  word writeAddress;
46  byte addressLatch;
47  byte writeLatch;
48  byte mode;
49 };
50 
51 } // namespace openmsx
52 
53 #endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXHBI55.cc:49
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXHBI55.cc:64
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:59
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:69
void serialize(Archive &ar, unsigned version)
Definition: MSXHBI55.cc:164
MSXHBI55(const DeviceConfig &config)
Definition: MSXHBI55.cc:41
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint8_t nibble
4 bit integer
Definition: openmsx.hh:23
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29