26 , scc(getName() +
" SCC", config, getCurrentTime())
31 "The size of this ROM image is larger than 512kB, "
32 "which is not supported on real Konami SCC mapper "
44void RomKonamiSCC::bankSwitch(
unsigned page,
unsigned block)
49 if (page == 2 || page == 3) {
52 }
else if (page == 4 || page == 5) {
62 for (
auto i :
xrange(2, 6)) {
72 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
73 return scc.
peekMem(narrow_cast<uint8_t>(address & 0xFF), time);
81 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
82 return scc.
readMem(narrow_cast<uint8_t>(address & 0xFF), time);
90 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
100 if ((address < 0x5000) || (address >= 0xC000)) {
103 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
105 scc.
writeMem(narrow_cast<uint8_t>(address & 0xFF), value, time);
108 if ((address & 0xF800) == 0x9000) {
110 bool newSccEnabled = ((value & 0x3F) == 0x3F);
111 if (newSccEnabled != sccEnabled) {
112 sccEnabled = newSccEnabled;
116 if ((address & 0x1800) == 0x1000) {
118 auto region = address >> 13;
119 bankSwitch(region, value);
120 if ((region == 4) && sccEnabled) {
128 if ((address < 0x5000) || (address >= 0xC000)) {
130 }
else if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
144template<
typename Archive>
147 ar.template serializeBase<Rom8kBBlocks>(*
this);
148 ar.serialize(
"scc", scc,
149 "sccEnabled", sccEnabled);
#define REGISTER_MSXDEVICE(CLASS, NAME)
void printWarning(std::string_view message)
MSXMotherBoard & getMotherBoard() const
Get the mother board this device belongs to.
void invalidateDeviceRCache()
static std::array< byte, 0x10000 > unmappedWrite
void invalidateDeviceRWCache()
Calls MSXCPUInterface::invalidateXXCache() for the specific (part of) the slot that this device is lo...
EmuTime::param getCurrentTime() const
MSXCliComm & getMSXCliComm()
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
void setRom(unsigned region, unsigned block)
Selects a block of the ROM image for reading in a certain region.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
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 peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
RomKonamiSCC(const DeviceConfig &config, Rom &&rom)
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void serialize(Archive &ar, unsigned version)
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
void reset(EmuTime::param time) override
This method is called on reset.
void powerUp(EmuTime::param time)
uint8_t readMem(uint8_t address, EmuTime::param time)
void reset(EmuTime::param time)
uint8_t peekMem(uint8_t address, EmuTime::param time) const
void writeMem(uint8_t address, uint8_t value, EmuTime::param time)
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
constexpr auto xrange(T e)