23 ,
public GlobalReadClient<Carnivore2, CT_Interval<0x0000>, CT_Interval<0x4000, 0x4010>>
29 void powerUp(EmuTime::param time)
override;
30 void reset(EmuTime::param time)
override;
32 [[nodiscard]]
byte readMem(
word address, EmuTime::param time)
override;
33 [[nodiscard]]
byte peekMem(
word address, EmuTime::param time)
const override;
34 void writeMem(
word address,
byte value, EmuTime::param time)
override;
37 [[nodiscard]]
byte readIO(
word port, EmuTime::param time)
override;
38 [[nodiscard]]
byte peekIO(
word port, EmuTime::param time)
const override;
39 void writeIO(
word port,
byte value, EmuTime::param time)
override;
42 template<
typename Archive>
43 void serialize(Archive& ar,
unsigned version);
47 [[nodiscard]]
unsigned getDirectFlashAddr()
const;
48 [[nodiscard]]
byte peekConfigRegister(
word address, EmuTime::param time)
const;
49 [[nodiscard]]
byte readConfigRegister(
word address, EmuTime::param time);
50 void writeSndLVL(
byte value, EmuTime::param time);
51 void writeCfgEEPR(
byte value, EmuTime::param time);
52 void writeConfigRegister(
word address,
byte value, EmuTime::param time);
54 [[nodiscard]]
bool sccEnabled()
const {
return configRegs[0x00] & 0x10; }
55 [[nodiscard]]
bool delayedConfig()
const {
return configRegs[0x00] & 0x08; }
56 [[nodiscard]]
bool delayedConfig4000()
const {
return configRegs[0x00] & 0x04; }
57 [[nodiscard]]
bool readBIOSfromRAM()
const {
return configRegs[0x00] & 0x02; }
59 [[nodiscard]]
bool slotExpanded()
const {
return configRegs[0x1e] & 0x80; }
60 [[nodiscard]]
bool memMapReadEnabled()
const {
61 return (configRegs[0x1e] & 0x40) && !(port3C & 0x20);
63 [[nodiscard]]
bool fmPacPortEnabled2()
const {
return configRegs[0x1e] & 0x20; }
64 [[nodiscard]]
bool subSlotEnabled(
unsigned slot)
const {
66 return configRegs[0x1e] & (1 << slot);
68 [[nodiscard]]
bool writePort3cEnabled()
const {
69 return (configRegs[0x1e] & 0x10) && !(port3C & 0x20);
72 enum class SubDevice { MultiMapper, IDE, MemoryMapper, FmPac, Nothing };
74 [[nodiscard]] SubDevice getSubDevice(
word address)
const;
77 [[nodiscard]]
bool isConfigReg(
word address)
const;
78 [[nodiscard]] std::pair<unsigned, byte> decodeMultiMapper(
word address)
const;
79 [[nodiscard]]
bool sccAccess(
word address)
const;
80 [[nodiscard]]
byte readMultiMapperSlot(
word address, EmuTime::param time);
81 [[nodiscard]]
byte peekMultiMapperSlot(
word address, EmuTime::param time)
const;
82 void writeMultiMapperSlot(
word address,
byte value, EmuTime::param time);
85 [[nodiscard]]
byte readIDESlot(
word address, EmuTime::param time);
86 [[nodiscard]]
byte peekIDESlot(
word address, EmuTime::param time)
const;
87 void writeIDESlot(
word address,
byte value, EmuTime::param time);
88 [[nodiscard]]
word ideReadData(EmuTime::param time);
89 void ideWriteData(
word value, EmuTime::param time);
90 [[nodiscard]]
byte ideReadReg(
byte reg, EmuTime::param time);
91 void ideWriteReg(
byte reg,
byte value, EmuTime::param time);
92 [[nodiscard]]
bool ideRegsEnabled()
const {
return ideControlReg & 0x01; }
93 [[nodiscard]]
byte ideBank()
const {
return Math::reverseByte(ideControlReg & 0xe0); }
96 [[nodiscard]]
bool isMemmapControl(
word address)
const;
97 [[nodiscard]]
unsigned getMemoryMapperAddress(
word address)
const;
98 [[nodiscard]]
bool isMemoryMapperWriteProtected(
word address)
const;
99 [[nodiscard]]
byte peekMemoryMapperSlot(
word address)
const;
100 [[nodiscard]]
byte readMemoryMapperSlot(
word address);
101 void writeMemoryMapperSlot(
word address,
byte value);
104 [[nodiscard]]
byte readFmPacSlot(
word address);
105 [[nodiscard]]
byte peekFmPacSlot(
word address)
const;
106 void writeFmPacSlot(
word address,
byte value, EmuTime::param time);
107 [[nodiscard]]
bool fmPacPortEnabled1()
const {
return fmPacEnable & 0x01; }
108 [[nodiscard]]
bool fmPacSramEnabled()
const {
109 return (fmPac5ffe == 0x4d) && (fmPac5fff == 0x69);
117 byte shadowConfigRegs[64];
127 std::unique_ptr<IDEDevice> ideDevices[2];
129 byte ideSelectedDevice;
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
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.
void serialize(Archive &ar, unsigned version)
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
void globalRead(word address, EmuTime::param time) override
Global reads.
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Carnivore2(const DeviceConfig &config)
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 peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
byte getSelectedSegment(byte page) const override
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
constexpr uint8_t reverseByte(uint8_t a)
Reverse the bits in a byte.
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)