added that peeks to ROM hotspots return random values

This commit is contained in:
thrust26 2023-10-02 10:04:05 +02:00
parent b2004d0c49
commit 28d21eb42b
3 changed files with 7 additions and 6 deletions

View File

@ -259,7 +259,7 @@ bool CartridgeAR::bankConfiguration(uInt8 configuration)
void CartridgeAR::initializeROM()
{
// Note that the following offsets depend on the 'scrom.asm' file
// in src/emucore/misc. If that file is ever recompiled (and its
// in src/tools. If that file is ever recompiled (and its
// contents placed in the ourDummyROMCode array), the offsets will
// almost definitely change

View File

@ -160,8 +160,9 @@ uInt8 CartridgeEnhanced::peek(uInt16 address)
}
// hotspots in TIA range are reacting to pokes only
if (hotspot() >= 0x80)
checkSwitchBank(address & ADDR_MASK, 0);
if(hotspot() >= 0x80)
if(checkSwitchBank(address & ADDR_MASK, 0))
return myRWPRandomValues[address & 0xFF];
if(isRamBank(address))
{
@ -300,7 +301,7 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
// Set the page accessing method for the RAM reading pages
fromAddr = (ROM_OFFSET + segmentOffset + myReadOffset) & ~System::PAGE_MASK;
toAddr = (ROM_OFFSET + segmentOffset + myReadOffset
toAddr = (ROM_OFFSET + segmentOffset + myReadOffset
+ (myBankSize >> (myBankShift - myRamBankShift))) & ~System::PAGE_MASK;
access.type = System::PageAccessType::READ;

View File

@ -37,14 +37,14 @@ class CartridgeMVC : public Cartridge
{
public:
static constexpr size_t
MVC_FIELD_SIZE = 4096;
MVC_FIELD_SIZE = 4_KB;
public:
/**
Create a new cartridge using the specified image
@param path Path to the ROM image file
@param size The size of the ROM image (<= 2048 bytes)
@param size The size of the ROM image
@param md5 The md5sum of the ROM image
@param settings A reference to the various settings (read-only)
@param bsSize The size specified by the bankswitching scheme