openMSX
ChakkariCopy.hh
Go to the documentation of this file.
1 #ifndef CHAKKARICOPY_HH
2 #define CHAKKARICOPY_HH
3 
4 #include "MSXDevice.hh"
5 #include "EnumSetting.hh"
6 #include "BooleanSetting.hh"
7 #include "Ram.hh"
8 #include "Rom.hh"
9 
10 namespace openmsx {
11 
12 class ChakkariCopy final : public MSXDevice, private Observer<Setting>
13 {
14 public:
15  enum Mode { COPY, RAM };
16 
17  explicit ChakkariCopy(const DeviceConfig& config);
18  ~ChakkariCopy() override;
19 
20  void reset(EmuTime::param time) override;
21  void writeIO(word port, byte value, EmuTime::param time) override;
22  byte readIO(word port, EmuTime::param time) override;
23  byte peekIO(word port, EmuTime::param time) const override;
24  byte readMem(word address, EmuTime::param time) override;
25  byte peekMem(word address, EmuTime::param time) const override;
26  const byte* getReadCacheLine(word address) const override;
27  void writeMem(word address, byte value, EmuTime::param time) override;
28  byte* getWriteCacheLine(word address) const override;
29 
30  template<typename Archive>
31  void serialize(Archive& ar, unsigned version);
32 
33 private:
34  // Observer<Setting>
35  void update(const Setting& setting) override;
36 
37  Ram biosRam;
38  Ram workRam;
39  Rom rom;
40 
41  BooleanSetting pauseButtonPressedSetting;
42  BooleanSetting copyButtonPressedSetting;
43  EnumSetting<Mode> modeSetting;
44 
45  byte reg;
46 };
47 
48 } // namespace openmsx
49 
50 #endif
openmsx::EnumSetting< Mode >
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::ChakkariCopy::RAM
Definition: ChakkariCopy.hh:15
Rom.hh
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::ChakkariCopy::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: ChakkariCopy.cc:142
openmsx::Setting
Definition: Setting.hh:119
BooleanSetting.hh
Ram.hh
openmsx::ChakkariCopy::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: ChakkariCopy.cc:137
openmsx::ChakkariCopy::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: ChakkariCopy.cc:155
openmsx::ChakkariCopy::getReadCacheLine
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: ChakkariCopy.cc:160
openmsx::ChakkariCopy::COPY
Definition: ChakkariCopy.hh:15
openmsx::ChakkariCopy::~ChakkariCopy
~ChakkariCopy() override
Definition: ChakkariCopy.cc:106
MSXDevice.hh
openmsx::ChakkariCopy::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: ChakkariCopy.cc:150
EnumSetting.hh
openmsx::ChakkariCopy
Definition: ChakkariCopy.hh:12
openmsx::Rom
Definition: Rom.hh:20
openmsx::ChakkariCopy::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ChakkariCopy.cc:111
openmsx::ChakkariCopy::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: ChakkariCopy.cc:116
openmsx::Ram
Definition: Ram.hh:15
openmsx::ChakkariCopy::Mode
Mode
Definition: ChakkariCopy.hh:15
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::BooleanSetting
Definition: BooleanSetting.hh:8
openmsx::ChakkariCopy::serialize
void serialize(Archive &ar, unsigned version)
Definition: ChakkariCopy.cc:217
openmsx::ChakkariCopy::ChakkariCopy
ChakkariCopy(const DeviceConfig &config)
Definition: ChakkariCopy.cc:84
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
openmsx::ChakkariCopy::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: ChakkariCopy.cc:189
openmsx::ChakkariCopy::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: ChakkariCopy.cc:184