mirror of https://github.com/stella-emu/stella.git
add access counting to many more bankswitching types
This commit is contained in:
parent
7a03f330f0
commit
3f7db393ba
|
@ -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) << ","
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue