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