23 void powerUp(EmuTime::param time)
override;
24 void reset(EmuTime::param time)
override;
25 [[nodiscard]]
byte peekMem(
word address, EmuTime::param time)
const override;
26 [[nodiscard]]
byte readMem(
word address, EmuTime::param time)
override;
28 void writeMem(
word address,
byte value, EmuTime::param time)
override;
31 void writeIO(
word port,
byte value, EmuTime::param time)
override;
33 template<
typename Archive>
34 void serialize(Archive& ar,
unsigned version);
37 enum SCCEnable { EN_NONE, EN_SCC, EN_SCCPLUS };
38 [[nodiscard]] SCCEnable getSCCEnable()
const;
39 void updateConfigReg(
byte value);
41 [[nodiscard]]
byte getSubSlot(
unsigned addr)
const;
46 void writeToFlash(
unsigned addr,
byte value);
51 [[nodiscard]]
byte readMemSubSlot0(
word address);
52 [[nodiscard]]
byte peekMemSubSlot0(
word address)
const;
53 [[nodiscard]]
const byte* getReadCacheLineSubSlot0(
word address)
const;
54 [[nodiscard]]
byte* getWriteCacheLineSubSlot0(
word address);
55 void writeMemSubSlot0(
word address,
byte value);
59 [[nodiscard]]
byte readMemSubSlot1(
word address, EmuTime::param time);
60 [[nodiscard]]
byte peekMemSubSlot1(
word address, EmuTime::param time)
const;
61 [[nodiscard]]
const byte* getReadCacheLineSubSlot1(
word address)
const;
62 [[nodiscard]]
byte* getWriteCacheLineSubSlot1(
word address);
63 void writeMemSubSlot1(
word address,
byte value, EmuTime::param time);
64 [[nodiscard]]
unsigned getFlashAddrSubSlot1(
unsigned addr)
const;
70 [[nodiscard]]
bool is64KmapperConfigured()
const {
return (mapperReg & 0xC0) == 0x40; }
71 [[nodiscard]]
bool isKonamiSCCmapperConfigured()
const {
return (mapperReg & 0xE0) == 0x00; }
72 [[nodiscard]]
bool isWritingKonamiBankRegisterDisabled()
const {
return (mapperReg & 0x08) != 0; }
73 [[nodiscard]]
bool isMapperRegisterDisabled()
const {
return (mapperReg & 0x04) != 0; }
74 [[nodiscard]]
bool areBankRegsAndOffsetRegsDisabled()
const {
return (mapperReg & 0x02) != 0; }
75 [[nodiscard]]
bool areKonamiMapperLimitsEnabled()
const {
return (mapperReg & 0x01) != 0; }
79 [[nodiscard]]
bool isConfigRegDisabled()
const {
return (configReg & 0x80) != 0; }
80 [[nodiscard]]
bool isMemoryMapperEnabled()
const {
return ((configReg & 0x20) == 0) && checkedRam; }
81 [[nodiscard]]
bool isDSKmodeEnabled()
const {
return (configReg & 0x10) != 0; }
82 [[nodiscard]]
bool isPSGalsoMappedToNormalPorts()
const {
return (configReg & 0x08) != 0; }
83 [[nodiscard]]
bool isSlotExpanderEnabled()
const {
return (configReg & 0x04) == 0; }
84 [[nodiscard]]
bool isFlashRomBlockProtectEnabled()
const {
return (configReg & 0x02) != 0; }
85 [[nodiscard]]
bool isFlashRomWriteEnabled()
const {
return (configReg & 0x01) != 0; }
87 std::array<byte, 4> bankRegsSubSlot1;
90 std::array<byte, 4> sccBanks;
94 [[nodiscard]]
byte readMemSubSlot2(
word address);
95 [[nodiscard]]
byte peekMemSubSlot2(
word address)
const;
96 [[nodiscard]]
const byte* getReadCacheLineSubSlot2(
word address)
const;
97 [[nodiscard]]
byte* getWriteCacheLineSubSlot2(
word address);
98 void writeMemSubSlot2(
word address,
byte value);
100 [[nodiscard]]
unsigned calcMemMapperAddress(
word address)
const;
101 [[nodiscard]]
unsigned calcAddress(
word address)
const;
111 [[nodiscard]]
byte readIO(
word port, EmuTime::param time)
override;
112 [[nodiscard]]
byte peekIO(
word port, EmuTime::param time)
const override;
113 void writeIO(
word port,
byte value, EmuTime::param time)
override;
114 [[nodiscard]]
byte getSelectedSegment(
byte page)
const override;
119 const std::unique_ptr<CheckedRam> checkedRam;
120 const std::unique_ptr<MapperIO> mapperIO;
121 std::array<byte, 4> memMapperRegs;
124 [[nodiscard]]
byte readMemSubSlot3(
word address, EmuTime::param time);
125 [[nodiscard]]
byte peekMemSubSlot3(
word address, EmuTime::param time)
const;
126 [[nodiscard]]
const byte* getReadCacheLineSubSlot3(
word address)
const;
127 [[nodiscard]]
byte* getWriteCacheLineSubSlot3(
word address);
128 void writeMemSubSlot3(
word address,
byte value, EmuTime::param time);
129 [[nodiscard]]
unsigned getFlashAddrSubSlot3(
unsigned addr)
const;
131 std::array<byte, 4> bankRegsSubSlot3;
134 std::array<std::unique_ptr<SdCard>, 2> sdCard;