openMSX
ColecoSuperGameModule.hh
Go to the documentation of this file.
1 #ifndef COLECOSUPERGAMEMODULE_HH
2 #define COLECOSUPERGAMEMODULE_HH
3 
4 #include "MSXDevice.hh"
5 #include "AY8910.hh"
6 #include "Rom.hh"
7 #include "CheckedRam.hh"
8 
9 namespace openmsx {
10 
11 class ColecoSuperGameModule final : public MSXDevice
12 {
13 public:
14  ColecoSuperGameModule(const DeviceConfig& config);
15  ~ColecoSuperGameModule() override;
16 
17  void reset(EmuTime::param time) override;
18  byte readIO(word port, EmuTime::param time) override;
19  byte peekIO(word port, EmuTime::param time) const override;
20  void writeIO(word port, byte value, EmuTime::param time) override;
21  byte peekMem(word address, EmuTime::param time) const override;
22  byte readMem(word address, EmuTime::param time) override;
23  void writeMem(word address, byte value, EmuTime::param time) override;
24  const byte* getReadCacheLine(word start) const override;
25  byte* getWriteCacheLine(word start) const override;
26 
27  template<typename Archive>
28  void serialize(Archive& ar, unsigned version);
29 
30 private:
31  unsigned translateMainRamAddress(unsigned address) const;
32 
33  AY8910 psg;
34  CheckedRam sgmRam;
35  CheckedRam mainRam;
36  Rom biosRom;
37  byte psgLatch;
38  bool ramEnabled;
39  bool ramAtBiosEnabled;
40 };
41 
42 } // namespace openmsx
43 
44 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::ColecoSuperGameModule::writeMem
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
Definition: ColecoSuperGameModule.cc:126
Rom.hh
openmsx::ColecoSuperGameModule::writeIO
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: ColecoSuperGameModule.cc:75
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::ColecoSuperGameModule::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ColecoSuperGameModule.cc:50
AY8910.hh
CheckedRam.hh
openmsx::ColecoSuperGameModule::getReadCacheLine
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: ColecoSuperGameModule.cc:141
openmsx::ColecoSuperGameModule::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: ColecoSuperGameModule.cc:67
MSXDevice.hh
openmsx::ColecoSuperGameModule::ColecoSuperGameModule
ColecoSuperGameModule(const DeviceConfig &config)
Definition: ColecoSuperGameModule.cc:18
openmsx::Rom
Definition: Rom.hh:21
openmsx::AY8910
This class implements the AY-3-8910 sound chip.
Definition: AY8910.hh:20
openmsx::CheckedRam
This class keeps track of which bytes in the Ram have been written to.
Definition: CheckedRam.hh:28
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::ColecoSuperGameModule
Definition: ColecoSuperGameModule.hh:12
openmsx::ColecoSuperGameModule::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: ColecoSuperGameModule.cc:98
openmsx::ColecoSuperGameModule::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: ColecoSuperGameModule.cc:112
openmsx::ColecoSuperGameModule::getWriteCacheLine
byte * getWriteCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: ColecoSuperGameModule.cc:155
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::ColecoSuperGameModule::~ColecoSuperGameModule
~ColecoSuperGameModule() override
Definition: ColecoSuperGameModule.cc:36
openmsx::ColecoSuperGameModule::serialize
void serialize(Archive &ar, unsigned version)
Definition: ColecoSuperGameModule.cc:172
openmsx::ColecoSuperGameModule::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: ColecoSuperGameModule.cc:59