openMSX
ReproCartridgeV1.hh
Go to the documentation of this file.
1 #ifndef REPROCARTRIDGEV1_HH
2 #define REPROCARTRIDGEV1_HH
3 
4 #include "MSXRom.hh"
5 #include "AmdFlash.hh"
6 #include "SCC.hh"
7 #include "AY8910.hh"
8 
9 namespace openmsx {
10 
11 class ReproCartridgeV1 final : public MSXRom
12 {
13 public:
14  ReproCartridgeV1(const DeviceConfig& config, Rom&& rom);
15  ~ReproCartridgeV1() override;
16 
17  void powerUp(EmuTime::param time) override;
18  void reset(EmuTime::param time) override;
19  byte peekMem(word address, EmuTime::param time) const override;
20  byte readMem(word address, EmuTime::param time) override;
21  const byte* getReadCacheLine(word address) const override;
22  void writeMem(word address, byte value, EmuTime::param time) override;
23  byte* getWriteCacheLine(word address) const override;
24 
25  void writeIO(word port, byte value, EmuTime::param time) override;
26 
27  void setVolume(EmuTime::param time, byte value);
28 
29  template<typename Archive>
30  void serialize(Archive& ar, unsigned version);
31 
32 private:
33  bool isSCCAccess(word addr) const;
34  unsigned getFlashAddr(unsigned addr) const;
35 
36 private:
37  AmdFlash flash;
38  SCC scc;
39  AY8910 psg;
40 
41  bool flashRomWriteEnabled;
42  byte mainBankReg;
43  byte psgLatch;
44  byte sccMode;
45  byte bankRegs[4];
46 };
47 
48 } // namespace openmsx
49 
50 #endif
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
This class implements the AY-3-8910 sound chip.
Definition: AY8910.hh:19
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
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.
void reset(EmuTime::param time) override
This method is called on reset.
ReproCartridgeV1(const DeviceConfig &config, Rom &&rom)
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.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading...
void setVolume(EmuTime::param time, byte value)
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing...
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
void serialize(Archive &ar, unsigned version)
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.