added missing PlusROM code to CartBUS.cxx

This commit is contained in:
Thomas Jentzsch 2022-06-06 22:26:47 +02:00
parent 77afcc4de6
commit e9887146ad
1 changed files with 17 additions and 0 deletions

View File

@ -78,6 +78,11 @@ CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size,
this); this);
this->setInitialState(); this->setInitialState();
myPlusROM = make_unique<PlusROM>(mySettings, *this);
// Determine whether we have a PlusROM cart
myPlusROM->initialize(myImage, size);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -186,6 +191,14 @@ inline void CartridgeBUS::callFunction(uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 CartridgeBUS::peek(uInt16 address) uInt8 CartridgeBUS::peek(uInt16 address)
{ {
// Is this a PlusROM?
if(myPlusROM->isValid())
{
uInt8 value = 0;
if(myPlusROM->peekHotspot(address, value))
return value;
}
if(!(address & 0x1000)) // Hotspots below 0x1000 if(!(address & 0x1000)) // Hotspots below 0x1000
{ {
// Check for RAM or TIA mirroring // Check for RAM or TIA mirroring
@ -340,6 +353,10 @@ uInt8 CartridgeBUS::peek(uInt16 address)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeBUS::poke(uInt16 address, uInt8 value) bool CartridgeBUS::poke(uInt16 address, uInt8 value)
{ {
// Is this a PlusROM?
if(myPlusROM->isValid() && myPlusROM->pokeHotspot(address, value))
return true;
if (!(address & 0x1000)) if (!(address & 0x1000))
{ {
value &= busOverdrive(address); value &= busOverdrive(address);