25 ,
public GlobalReadClient<Carnivore2, CT_Interval<0x0000>, CT_Interval<0x4000, 0x4010>>
31 void powerUp(EmuTime::param time)
override;
32 void reset(EmuTime::param time)
override;
34 [[nodiscard]]
byte readMem(
word address, EmuTime::param time)
override;
35 [[nodiscard]]
byte peekMem(
word address, EmuTime::param time)
const override;
36 void writeMem(
word address,
byte value, EmuTime::param time)
override;
39 [[nodiscard]]
byte readIO(
word port, EmuTime::param time)
override;
40 [[nodiscard]]
byte peekIO(
word port, EmuTime::param time)
const override;
41 void writeIO(
word port,
byte value, EmuTime::param time)
override;
44 template<
typename Archive>
45 void serialize(Archive& ar,
unsigned version);
49 [[nodiscard]]
unsigned getDirectFlashAddr()
const;
50 [[nodiscard]]
byte peekConfigRegister(
word address, EmuTime::param time)
const;
51 [[nodiscard]]
byte readConfigRegister(
word address, EmuTime::param time);
52 void writeSndLVL(
byte value, EmuTime::param time);
53 void writeCfgEEPR(
byte value, EmuTime::param time);
54 void writePSGCtrl(
byte value, EmuTime::param time);
55 void writePSGAlt(
byte value);
56 void writePFXN(
byte value);
57 void writeConfigRegister(
word address,
byte value, EmuTime::param time);
59 [[nodiscard]]
bool sccEnabled()
const {
return configRegs[0x00] & 0x10; }
60 [[nodiscard]]
bool delayedConfig()
const {
return configRegs[0x00] & 0x08; }
61 [[nodiscard]]
bool delayedConfig4000()
const {
return configRegs[0x00] & 0x04; }
62 [[nodiscard]]
bool readBIOSfromRAM()
const {
return configRegs[0x00] & 0x02; }
64 [[nodiscard]]
bool slotExpanded()
const {
return configRegs[0x1e] & 0x80; }
65 [[nodiscard]]
bool memMapReadEnabled()
const {
66 return (configRegs[0x1e] & 0x40) && !(port3C & 0x20);
68 [[nodiscard]]
bool fmPacPortEnabled2()
const {
return configRegs[0x1e] & 0x20; }
69 [[nodiscard]]
bool subSlotEnabled(
unsigned slot)
const {
71 return configRegs[0x1e] & (1 << slot);
73 [[nodiscard]]
bool writePort3cEnabled()
const {
74 return (configRegs[0x1e] & 0x10) && !(port3C & 0x20);
77 enum class SubDevice { MultiMapper, IDE, MemoryMapper, FmPac, Nothing };
79 [[nodiscard]] SubDevice getSubDevice(
word address)
const;
82 [[nodiscard]]
bool isConfigReg(
word address)
const;
83 [[nodiscard]] std::pair<unsigned, byte> decodeMultiMapper(
word address)
const;
84 [[nodiscard]]
bool sccAccess(
word address)
const;
85 [[nodiscard]]
byte readMultiMapperSlot(
word address, EmuTime::param time);
86 [[nodiscard]]
byte peekMultiMapperSlot(
word address, EmuTime::param time)
const;
87 void writeMultiMapperSlot(
word address,
byte value, EmuTime::param time);
90 [[nodiscard]]
byte readIDESlot(
word address, EmuTime::param time);
91 [[nodiscard]]
byte peekIDESlot(
word address, EmuTime::param time)
const;
92 void writeIDESlot(
word address,
byte value, EmuTime::param time);
93 [[nodiscard]]
word ideReadData(EmuTime::param time);
94 void ideWriteData(
word value, EmuTime::param time);
95 [[nodiscard]]
byte ideReadReg(
byte reg, EmuTime::param time);
96 void ideWriteReg(
byte reg,
byte value, EmuTime::param time);
97 [[nodiscard]]
bool ideRegsEnabled()
const {
return ideControlReg & 0x01; }
98 [[nodiscard]]
byte ideBank()
const {
return Math::reverseByte(ideControlReg & 0xe0); }
101 [[nodiscard]]
bool isMemMapControl(
word address)
const;
102 [[nodiscard]]
unsigned getMemoryMapperAddress(
word address)
const;
103 [[nodiscard]]
bool isMemoryMapperWriteProtected(
word address)
const;
104 [[nodiscard]]
byte peekMemoryMapperSlot(
word address)
const;
105 [[nodiscard]]
byte readMemoryMapperSlot(
word address)
const;
106 void writeMemoryMapperSlot(
word address,
byte value);
109 [[nodiscard]]
byte readFmPacSlot(
word address);
110 [[nodiscard]]
byte peekFmPacSlot(
word address)
const;
111 void writeFmPacSlot(
word address,
byte value, EmuTime::param time);
112 [[nodiscard]]
bool fmPacPortEnabled1()
const {
return fmPacEnable & 0x01; }
113 [[nodiscard]]
bool fmPacSramEnabled()
const {
114 return (fmPac5ffe == 0x4d) && (fmPac5fff == 0x69);
117 [[nodiscard]]
byte idControlPort()
const {
return configRegs[0x35]; }
123 std::array<byte, 64> configRegs;
124 std::array<byte, 64> shadowConfigRegs;
131 std::array<byte, 4> sccBank;
138 std::array<std::unique_ptr<IDEDevice>, 2> ideDevices;
140 byte ideSelectedDevice;
146 std::array<byte, 4> memMapRegs;