15 : msxcpu(motherBoard.getCPU())
16 , rom([&]() -> std::optional<
Rom> {
18 getConfig().findChild(
"PanasonicRom");
19 if (!elem)
return std::nullopt;
23 return std::optional<Rom>(std::in_place,
24 "PanasonicRom",
"Turbor-R main ROM",
42 (((0x28 <= block) && (block < 0x2C)) ||
43 ((0x38 <= block) && (block < 0x3C)))) {
45 unsigned offset = (block & 0x03) * 0x2000;
46 unsigned ramOffset = (block < 0x30) ? ramSize - 0x10000 :
48 return ram + ramOffset + offset;
50 unsigned offset = block * 0x2000;
51 if (offset >= rom->getSize()) {
52 offset &= rom->getSize() - 1;
54 return &(*rom)[offset];
64 throw MSXException(
"Error in config file: firstblock must "
65 "be smaller than lastblock");
67 unsigned start = first * 0x2000;
68 if (start >= rom->getSize()) {
69 throw MSXException(
"Error in config file: firstblock lies "
70 "outside of rom image.");
72 unsigned stop = (last + 1) * 0x2000;
73 if (stop > rom->getSize()) {
74 throw MSXException(
"Error in config file: lastblock lies "
75 "outside of rom image.");
77 return &(*rom)[start];
82 if (!ram)
return nullptr;
84 unsigned offset = block * 0x2000;
85 if (offset >= ramSize) {
86 offset &= ramSize - 1;
101 return !dram || (address < (ramSize - 0x10000));
void invalidateAllSlotsRWCache(word start, unsigned size)
Invalidate the CPU its cache for the interval [start, start + size) For example MSXMemoryMapper and M...
const HardwareConfig * getMachineConfig() const
void registerRam(Ram &ram)
Pass reference of the actual Ram block for use in DRAM mode and RAM access via the ROM mapper.
bool isWritable(unsigned address) const
const byte * getRomBlock(unsigned block)
PanasonicMemory(MSXMotherBoard &motherBoard)
const byte * getRomRange(unsigned first, unsigned last)
byte * getRamBlock(unsigned block)
Note that this is always unchecked RAM! There is no UMR detection when accessing Ram in DRAM mode or ...
This file implemented 3 utility functions: