23 [[nodiscard]]
static TurboRFDC::Type parseType(
const DeviceConfig& config)
25 auto ioregs = config.getChildData(
"io_regs", {});
26 if (ioregs ==
"7FF2") {
28 }
else if (ioregs ==
"7FF8") {
30 }
else if (ioregs.empty()) {
35 "Invalid 'io_regs' specification: expected one of "
36 "'7FF2' or '7FF8', but got: ", ioregs);
42 , controller(getScheduler(), reinterpret_cast<
DiskDrive**>(drives),
43 getCliComm(), getCurrentTime())
44 , romBlockDebug(*this, &bank, 0x4000, 0x4000, 14)
45 , blockMask((rom->getSize() / 0x4000) - 1)
46 , type(parseType(config))
54 controller.
reset(time);
60 if (0x3FF0 <= (address & 0x3FFF)) {
67 switch (address & 0xF) {
79 switch (address & 0xF) {
93 if (0x3FF0 <= (address & 0x3FFF)) {
97 switch (address & 0xF) {
98 case 0x0:
return bank;
115 switch (address & 0xF) {
120 switch (address & 0xF) {
130 case 0xC:
return 0xFC;
131 case 0xD:
return 0xFC;
132 case 0xE:
return 0xFF;
133 case 0xF:
return 0x3F;
134 default:
return 0xFF;
136 }
else if ((0x4000 <= address) && (address < 0x8000)) {
137 return memory[address & 0x3FFF];
147 }
else if ((0x4000 <= start) && (start < 0x8000)) {
148 return &memory[start & 0x3FFF];
156 EmuTime time = time_;
157 if (0x3FF0 <= (address & 0x3FFF)) {
161 if (address == 0x7FF0) {
165 switch (address & 0x3FFF) {
178 switch (address & 0x3FFF) {
193 void TurboRFDC::setBank(
byte value)
196 bank = value & blockMask;
197 memory = &(*rom)[0x4000 * bank];
211 template<
typename Archive>
214 ar.template serializeBase<MSXFDC>(*
this);
215 ar.serialize(
"TC8566AF", controller,
217 if constexpr (Archive::IS_LOADER) {
This (abstract) class defines the DiskDrive interface.
EmuTime waitCyclesR800(EmuTime::param time, unsigned cycles)
void invalidateDeviceRCache()
static byte unmappedRead[0x10000]
EmuTime::param getCurrentTime() const
static byte unmappedWrite[0x10000]
void writeDataPort(byte value, EmuTime::param time)
byte peekDataPort(EmuTime::param time) const
byte readDataPort(EmuTime::param time)
byte readStatus(EmuTime::param time)
void writeControlReg1(byte value, EmuTime::param time)
void reset(EmuTime::param time)
void writeControlReg0(byte value, EmuTime::param time)
bool peekDiskChanged(unsigned driveNum) const
bool diskChanged(unsigned driveNum)
void reset(EmuTime::param time) override
This method is called on reset.
void serialize(Archive &ar, unsigned version)
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
TurboRFDC(const DeviceConfig &config)
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.
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
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:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)