30 , programRom (
strCat(config.getAttributeValue(
"id"),
"_program"),
"rom", config,
"program")
31 , dictionaryRom(
strCat(config.getAttributeValue(
"id"),
"_dictionary"),
"rom", config,
"dictionary")
33 if (programRom.
size() != 32*1024) {
36 if (dictionaryRom.
size() != 3*128*1024) {
39 reset(EmuTime::dummy());
54 if ((0xbff8 <= address) && (address <= 0xbfff)) {
57 if (
const auto* a = readHelper(address)) {
69 return readHelper(start);
73const byte* CanonWordProcessor::readHelper(
word address)
const
75 if ((0x4000 <= address) && (address <= 0x7fff)) {
76 auto chip = (select & 0b00'111'000) >> 3;
77 auto bank = (select & 0b00'011'111);
81 return &programRom[address];
82 case 0b100:
case 0b101:
case 0b110:
83 return &dictionaryRom[0x4000 * bank + address];
92 return &programRom[0x4000 + (address & 0x3fff)];
98 if ((0xbff8 <= address) && (address <= 0xbfff)) {
109template<
typename Archive>
112 ar.template serializeBase<MSXDevice>(*
this);
113 ar.serialize(
"select", select);
#define REGISTER_MSXDEVICE(CLASS, NAME)
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.
byte * getWriteCacheLine(word start) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
CanonWordProcessor(const DeviceConfig &config)
void reset(EmuTime::param time) override
This method is called on reset.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
void serialize(Archive &ar, unsigned version)
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
void invalidateDeviceRCache()
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)