openMSX
MSXRTC.hh
Go to the documentation of this file.
1 #ifndef MSXRTC_HH
2 #define MSXRTC_HH
3 
4 #include "MSXDevice.hh"
5 #include "SRAM.hh"
6 #include "RP5C01.hh"
7 
8 namespace openmsx {
9 
10 class MSXRTC final : public MSXDevice
11 {
12 public:
13  explicit MSXRTC(const DeviceConfig& config);
14 
15  void reset(EmuTime::param time) override;
16  byte readIO(word port, EmuTime::param time) override;
17  byte peekIO(word port, EmuTime::param time) const override;
18  void writeIO(word port, byte value, EmuTime::param time) override;
19 
20  template<typename Archive>
21  void serialize(Archive& ar, unsigned version);
22 
23 private:
24  SRAM sram;
25  RP5C01 rp5c01;
26  nibble registerLatch;
27 };
28 
29 } // namespace openmsx
30 
31 #endif
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXRTC.cc:15
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
MSXRTC(const DeviceConfig &config)
Definition: MSXRTC.cc:7
void serialize(Archive &ar, unsigned version)
Definition: MSXRTC.cc:49
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXRTC.cc:29
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
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: MSXRTC.cc:34
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: MSXRTC.cc:24