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