diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index a4fe19857..2c2700c31 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -152,14 +152,16 @@ string Cartridge::getAccessCounters() const uInt16 origin = bankOrigin(bank); uInt16 bankSize = this->bankSize(bank); - out << "Bank " << bank << " / 0.." << bankCount() - 1 << " reads:\n"; + out << "Bank " << Common::Base::toString(bank, Common::Base::Fmt::_10_8) << " / 0.." + << Common::Base::toString(bankCount() - 1, Common::Base::Fmt::_10_8) << " reads:\n"; for(uInt16 addr = 0; addr < bankSize; ++addr) { out << Common::Base::HEX4 << (addr | origin) << "," << Common::Base::toString(myRomAccessCounter[offset + addr], Common::Base::Fmt::_10_8) << ", "; } out << "\n"; - out << "Bank " << bank << " / 0.." << bankCount() - 1 << " writes:\n"; + out << "Bank " << Common::Base::toString(bank, Common::Base::Fmt::_10_8) << " / 0.." + << Common::Base::toString(bankCount() - 1, Common::Base::Fmt::_10_8) << " writes:\n"; for(uInt16 addr = 0; addr < bankSize; ++addr) { out << Common::Base::HEX4 << (addr | origin) << "," diff --git a/src/emucore/Cart2K.cxx b/src/emucore/Cart2K.cxx index c5a5717c6..2a66a15ce 100644 --- a/src/emucore/Cart2K.cxx +++ b/src/emucore/Cart2K.cxx @@ -77,8 +77,8 @@ void Cartridge2K::install(System& system) { access.directPeekBase = &myImage[addr & myMask]; access.romAccessBase = &myRomAccessBase[addr & myMask]; - access.romPeekCounter = &myRomAccessCounter[addr & 0x0FFF]; - access.romPokeCounter = &myRomAccessCounter[(addr & 0x0FFF) + mySize]; + access.romPeekCounter = &myRomAccessCounter[addr & myMask]; + access.romPokeCounter = &myRomAccessCounter[(addr & myMask) + mySize]; mySystem->setPageAccess(addr, access); } } diff --git a/src/emucore/Cart3F.cxx b/src/emucore/Cart3F.cxx index 47b5c4dcd..796a1cd88 100644 --- a/src/emucore/Cart3F.cxx +++ b/src/emucore/Cart3F.cxx @@ -58,6 +58,8 @@ void Cartridge3F::install(System& system) { access.directPeekBase = &myImage[(mySize - 2048) + (addr & 0x07FF)]; access.romAccessBase = &myRomAccessBase[(mySize - 2048) + (addr & 0x07FF)]; + access.romPeekCounter = &myRomAccessCounter[(mySize - 2048) + (addr & 0x07FF)]; + access.romPokeCounter = &myRomAccessCounter[(mySize - 2048) + (addr & 0x07FF) + mySize]; mySystem->setPageAccess(addr, access); } @@ -118,6 +120,8 @@ bool Cartridge3F::bank(uInt16 bank) { access.directPeekBase = &myImage[offset + (addr & 0x07FF)]; access.romAccessBase = &myRomAccessBase[offset + (addr & 0x07FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x07FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x07FF) + mySize]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartBUS.cxx b/src/emucore/CartBUS.cxx index cb0be831f..c88db05fe 100644 --- a/src/emucore/CartBUS.cxx +++ b/src/emucore/CartBUS.cxx @@ -443,6 +443,8 @@ bool CartridgeBUS::bank(uInt16 bank) for(uInt16 addr = 0x1040; addr < 0x2000; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartCDF.cxx b/src/emucore/CartCDF.cxx index 3289b2e04..6bd8d3578 100644 --- a/src/emucore/CartCDF.cxx +++ b/src/emucore/CartCDF.cxx @@ -416,6 +416,8 @@ bool CartridgeCDF::bank(uInt16 bank) for(uInt16 addr = 0x1040; addr < 0x2000; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartCM.cxx b/src/emucore/CartCM.cxx index 7ce27bea4..3b3d35fa9 100644 --- a/src/emucore/CartCM.cxx +++ b/src/emucore/CartCM.cxx @@ -120,6 +120,8 @@ bool CartridgeCM::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -132,11 +134,15 @@ bool CartridgeCM::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; } else { access.directPeekBase = &myRAM[addr & 0x7FF]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x07FF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x07FF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x07FF) + myImage.size()]; } if((mySWCHA & 0x30) == 0x20) diff --git a/src/emucore/CartCTY.cxx b/src/emucore/CartCTY.cxx index 9133ca891..2c72e9030 100644 --- a/src/emucore/CartCTY.cxx +++ b/src/emucore/CartCTY.cxx @@ -241,6 +241,8 @@ bool CartridgeCTY::bank(uInt16 bank) for(uInt16 addr = 0x1080; addr < 0x2000; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartDPC.cxx b/src/emucore/CartDPC.cxx index 43d15dc7e..1fbec9791 100644 --- a/src/emucore/CartDPC.cxx +++ b/src/emucore/CartDPC.cxx @@ -374,6 +374,8 @@ bool CartridgeDPC::bank(uInt16 bank) addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -383,6 +385,8 @@ bool CartridgeDPC::bank(uInt16 bank) { access.directPeekBase = &myProgramImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index c9392fdc8..50cdeab39 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -605,6 +605,8 @@ bool CartridgeDPCPlus::bank(uInt16 bank) for(uInt16 addr = 0x1080; addr < 0x2000; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartE0.cxx b/src/emucore/CartE0.cxx index 9102788f2..051ff8870 100644 --- a/src/emucore/CartE0.cxx +++ b/src/emucore/CartE0.cxx @@ -62,12 +62,16 @@ void CartridgeE0::install(System& system) { access.directPeekBase = &myImage[0x1C00 + (addr & 0x03FF)]; access.romAccessBase = &myRomAccessBase[0x1C00 + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[0x1C00 + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[0x1C00 + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } // Set the page accessing methods for the hot spots in the last segment access.directPeekBase = nullptr; access.romAccessBase = &myRomAccessBase[0x1FC0]; // TJ: is this the correct address (or 0x1FE0)? + access.romPeekCounter = &myRomAccessCounter[0x1FC0]; + access.romPokeCounter = &myRomAccessCounter[0x1FC0 + myImage.size()]; access.type = System::PageAccessType::READ; for(uInt16 addr = (0x1FE0 & ~System::PAGE_MASK); addr < 0x2000; addr += System::PAGE_SIZE) @@ -145,6 +149,8 @@ void CartridgeE0::segmentZero(uInt16 slice) { access.directPeekBase = &myImage[offset + (addr & 0x03FF)]; access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myBankChanged = true; @@ -166,6 +172,8 @@ void CartridgeE0::segmentOne(uInt16 slice) { access.directPeekBase = &myImage[offset + (addr & 0x03FF)]; access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myBankChanged = true; @@ -187,6 +195,8 @@ void CartridgeE0::segmentTwo(uInt16 slice) { access.directPeekBase = &myImage[offset + (addr & 0x03FF)]; access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myBankChanged = true; diff --git a/src/emucore/CartEF.cxx b/src/emucore/CartEF.cxx index 1de837bf7..43901c916 100644 --- a/src/emucore/CartEF.cxx +++ b/src/emucore/CartEF.cxx @@ -85,6 +85,8 @@ bool CartridgeEF::bank(uInt16 bank) addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -94,6 +96,8 @@ bool CartridgeEF::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartEFSC.cxx b/src/emucore/CartEFSC.cxx index 4cb481547..b2fd87032 100644 --- a/src/emucore/CartEFSC.cxx +++ b/src/emucore/CartEFSC.cxx @@ -52,6 +52,8 @@ void CartridgeEFSC::install(System& system) for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[addr & 0x007F]; + access.romPeekCounter = &myRomAccessCounter[addr & 0x007F]; + access.romPokeCounter = &myRomAccessCounter[(addr & 0x007F) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -61,6 +63,8 @@ void CartridgeEFSC::install(System& system) { access.directPeekBase = &myRAM[addr & 0x007F]; access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)]; + access.romPeekCounter = &myRomAccessCounter[0x80 + (addr & 0x007F)]; + access.romPokeCounter = &myRomAccessCounter[0x80 + (addr & 0x007F) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -128,6 +132,8 @@ bool CartridgeEFSC::bank(uInt16 bank) addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -137,6 +143,8 @@ bool CartridgeEFSC::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartF0.cxx b/src/emucore/CartF0.cxx index 44f967327..fc6061d22 100644 --- a/src/emucore/CartF0.cxx +++ b/src/emucore/CartF0.cxx @@ -101,6 +101,8 @@ bool CartridgeF0::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } diff --git a/src/emucore/CartF8.cxx b/src/emucore/CartF8.cxx index 68485eb3b..66b42af70 100644 --- a/src/emucore/CartF8.cxx +++ b/src/emucore/CartF8.cxx @@ -110,8 +110,8 @@ bool CartridgeF8::bank(uInt16 bank) addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; - access.romPeekCounter = &myRomAccessCounter[myBankOffset + addr & 0x0FFF]; - access.romPokeCounter = &myRomAccessCounter[myBankOffset + addr & 0x0FFF + myImage.size()]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } diff --git a/src/emucore/CartFA.cxx b/src/emucore/CartFA.cxx index c91ea3b8e..eb9f1809b 100644 --- a/src/emucore/CartFA.cxx +++ b/src/emucore/CartFA.cxx @@ -52,6 +52,8 @@ void CartridgeFA::install(System& system) for(uInt16 addr = 0x1000; addr < 0x1100; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[addr & 0x00FF]; + access.romPeekCounter = &myRomAccessCounter[addr & 0x00FF]; + access.romPokeCounter = &myRomAccessCounter[(addr & 0x00FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -61,6 +63,8 @@ void CartridgeFA::install(System& system) { access.directPeekBase = &myRAM[addr & 0x00FF]; access.romAccessBase = &myRomAccessBase[0x100 + (addr & 0x00FF)]; + access.romPeekCounter = &myRomAccessCounter[0x100 + (addr & 0x00FF)]; + access.romPokeCounter = &myRomAccessCounter[0x100 + (addr & 0x00FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -158,6 +162,8 @@ bool CartridgeFA::bank(uInt16 bank) addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -167,6 +173,8 @@ bool CartridgeFA::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartFA2.cxx b/src/emucore/CartFA2.cxx index 57fb118bb..134c9d86b 100644 --- a/src/emucore/CartFA2.cxx +++ b/src/emucore/CartFA2.cxx @@ -62,6 +62,8 @@ void CartridgeFA2::install(System& system) for(uInt16 addr = 0x1000; addr < 0x1100; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[addr & 0x00FF]; + access.romPeekCounter = &myRomAccessCounter[addr & 0x00FF]; + access.romPokeCounter = &myRomAccessCounter[(addr & 0x00FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -72,6 +74,8 @@ void CartridgeFA2::install(System& system) { access.directPeekBase = &myRAM[addr & 0x00FF]; access.romAccessBase = &myRomAccessBase[0x100 + (addr & 0x00FF)]; + access.romPeekCounter = &myRomAccessCounter[0x100 + (addr & 0x00FF)]; + access.romPokeCounter = &myRomAccessCounter[0x100 + (addr & 0x00FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -223,6 +227,8 @@ bool CartridgeFA2::bank(uInt16 bank) addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -232,6 +238,8 @@ bool CartridgeFA2::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartFC.cxx b/src/emucore/CartFC.cxx index a35b531ca..113d259c3 100644 --- a/src/emucore/CartFC.cxx +++ b/src/emucore/CartFC.cxx @@ -114,6 +114,8 @@ bool CartridgeFC::bank(uInt16 bank) addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } @@ -123,6 +125,8 @@ bool CartridgeFC::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myCurrentBank = myTargetBank; diff --git a/src/emucore/CartUA.cxx b/src/emucore/CartUA.cxx index b4729c38e..ed2bd80bf 100644 --- a/src/emucore/CartUA.cxx +++ b/src/emucore/CartUA.cxx @@ -136,6 +136,8 @@ bool CartridgeUA::bank(uInt16 bank) { access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[myBankOffset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true; diff --git a/src/emucore/CartWD.cxx b/src/emucore/CartWD.cxx index 254c78aa4..62b5a6c17 100644 --- a/src/emucore/CartWD.cxx +++ b/src/emucore/CartWD.cxx @@ -64,6 +64,8 @@ void CartridgeWD::install(System& system) { read.directPeekBase = &myRAM[addr & 0x003F]; read.romAccessBase = &myRomAccessBase[addr & 0x003F]; + read.romPeekCounter = &myRomAccessCounter[addr & 0x003F]; + read.romPokeCounter = &myRomAccessCounter[(addr & 0x003F) + myImage.size()]; mySystem->setPageAccess(addr, read); } @@ -74,6 +76,8 @@ void CartridgeWD::install(System& system) for(uInt16 addr = 0x1040; addr < 0x1080; addr += System::PAGE_SIZE) { write.romAccessBase = &myRomAccessBase[addr & 0x003F]; + write.romPeekCounter = &myRomAccessCounter[addr & 0x003F]; + write.romPokeCounter = &myRomAccessCounter[(addr & 0x003F) + myImage.size()]; mySystem->setPageAccess(addr, write); } @@ -178,6 +182,8 @@ void CartridgeWD::segmentZero(uInt8 slice) for(uInt16 addr = 0x1080; addr < 0x1400; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myOffset[0] = offset; @@ -192,6 +198,8 @@ void CartridgeWD::segmentOne(uInt8 slice) for(uInt16 addr = 0x1400; addr < 0x1800; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myOffset[1] = offset; @@ -206,6 +214,8 @@ void CartridgeWD::segmentTwo(uInt8 slice) for(uInt16 addr = 0x1800; addr < 0x1C00; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myOffset[2] = offset; @@ -226,6 +236,8 @@ void CartridgeWD::segmentThree(uInt8 slice) for(uInt16 addr = 0x1C00; addr < 0x2000; addr += System::PAGE_SIZE) { access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x03FF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x03FF) + myImage.size()]; mySystem->setPageAccess(addr, access); } myOffset[3] = offset; diff --git a/src/emucore/CartX07.cxx b/src/emucore/CartX07.cxx index fc58b0df5..49fc30e0f 100644 --- a/src/emucore/CartX07.cxx +++ b/src/emucore/CartX07.cxx @@ -116,6 +116,8 @@ bool CartridgeX07::bank(uInt16 bank) { access.directPeekBase = &myImage[offset + (addr & 0x0FFF)]; access.romAccessBase = &myRomAccessBase[offset + (addr & 0x0FFF)]; + access.romPeekCounter = &myRomAccessCounter[offset + (addr & 0x0FFF)]; + access.romPokeCounter = &myRomAccessCounter[offset + (addr & 0x0FFF) + myImage.size()]; mySystem->setPageAccess(addr, access); } return myBankChanged = true;