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 #include "serialize_meta.hh"
9 
10 namespace openmsx {
11 
12 class MSXHBI55 final : public MSXDevice, public I8255Interface
13 {
14 public:
15  explicit MSXHBI55(const DeviceConfig& config);
16 
17  void reset(EmuTime::param time) override;
18  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
19  [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
20  void writeIO(word port, byte value, EmuTime::param time) override;
21 
22  template<typename Archive>
23  void serialize(Archive& ar, unsigned version);
24 
25 private:
26  // I8255Interface
27  [[nodiscard]] byte readA(EmuTime::param time) override;
28  [[nodiscard]] byte readB(EmuTime::param time) override;
29  [[nodiscard]] nibble readC0(EmuTime::param time) override;
30  [[nodiscard]] nibble readC1(EmuTime::param time) override;
31  [[nodiscard]] byte peekA(EmuTime::param time) const override;
32  [[nodiscard]] byte peekB(EmuTime::param time) const override;
33  [[nodiscard]] nibble peekC0(EmuTime::param time) const override;
34  [[nodiscard]] nibble peekC1(EmuTime::param time) const override;
35  void writeA(byte value, EmuTime::param time) override;
36  void writeB(byte value, EmuTime::param time) override;
37  void writeC0(nibble value, EmuTime::param time) override;
38  void writeC1(nibble value, EmuTime::param time) override;
39 
40  void writeStuff();
41  byte readStuff() const;
42 
43 private:
44  I8255 i8255;
45  SRAM sram;
46  byte lastC; // hack to approach a 'floating value'
47 };
49 
50 } // namespace openmsx
51 
52 #endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:33
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXHBI55.cc:75
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXHBI55.cc:86
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:81
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:91
void serialize(Archive &ar, unsigned version)
Definition: MSXHBI55.cc:205
MSXHBI55(const DeviceConfig &config)
Definition: MSXHBI55.cc:67
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
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)