25static Sha1Sum alreadyWarnedForSha1Sum;
29 , scc(
"SCC", config, getCurrentTime())
34 "The size of this ROM image is larger than 512kB, "
35 "which is not supported on real Konami SCC mapper "
52 for (
auto i :
xrange(2, 6)) {
64 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
65 return scc.
peekMem(narrow_cast<uint8_t>(address & 0xFF), time);
73 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
74 return scc.
readMem(narrow_cast<uint8_t>(address & 0xFF), time);
82 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
92 if ((address < 0x5000) || (address >= 0xC000)) {
95 if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
97 scc.
writeMem(narrow_cast<uint8_t>(address & 0xFF), value, time);
100 if ((address & 0xF800) == 0x9000) {
102 bool newSccEnabled = ((value & 0x3F) == 0x3F);
103 if (newSccEnabled != sccEnabled) {
104 sccEnabled = newSccEnabled;
108 if ((address & 0x1800) == 0x1000) {
110 auto region = address >> 13;
112 if ((region == 4) && sccEnabled) {
120 if ((address < 0x5000) || (address >= 0xC000)) {
122 }
else if (sccEnabled && (0x9800 <= address) && (address < 0xA000)) {
136template<
typename Archive>
139 ar.template serializeBase<Rom8kBBlocks>(*
this);
140 ar.serialize(
"scc", scc,
141 "sccEnabled", sccEnabled);
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
CliComm & getMSXCliComm()
void setUnmapped(unsigned region)
Select 'unmapped' memory for this region.
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 * 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.
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)
void reset(EmuTime::param time) override
This method is called on reset.
const Sha1Sum & getOriginalSHA1() const
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:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
constexpr auto xrange(T e)