9 , ram(config, getName() +
" RAM",
"MSXtra RAM", 0x0800)
11 for (
auto i :
xrange(0x800)) {
12 ram[i] = (i & 1) ? 0x5a : 0xa5;
18 if ((0x4000 <= address) && (address < 0x6000)) {
19 return rom[address & 0x1fff];
20 }
else if ((0x6000 <= address) && (address < 0x8000)) {
21 return ram[address & 0x07ff];
29 if ((0x4000 <= address) && (address < 0x6000)) {
30 return &
rom[address & 0x1fff];
31 }
else if ((0x6000 <= address) && (address < 0x8000)) {
32 return &ram[address & 0x07ff];
42 if ((0x6000 <= address) && (address < 0x8000)) {
43 ram[address & 0x07ff] = value;
49 if ((0x6000 <= address) && (address < 0x8000)) {
50 return &ram[address & 0x07ff];
56template<
typename Archive>
60 ar.template serializeBase<MSXDevice>(*
this);
61 ar.serialize(
"ram", ram);
#define REGISTER_MSXDEVICE(CLASS, NAME)
static std::array< byte, 0x10000 > unmappedRead
static std::array< byte, 0x10000 > unmappedWrite
void serialize(Archive &ar, unsigned version)
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
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 address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
RomMSXtra(const DeviceConfig &config, Rom &&rom)
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
constexpr auto xrange(T e)