rename code access into ROM access to better reflect the usage

This commit is contained in:
thrust26 2020-03-30 09:22:45 +02:00
parent 195a8a5116
commit d2fbbdbf61
47 changed files with 190 additions and 184 deletions

View File

@ -657,7 +657,7 @@ void DiStella::disasmPass1(CartDebug::AddressList& debuggerAddresses)
// Note that this is a 'best-effort' approach, since
// Distella will normally keep going until the end of the
// range or branch is encountered
// However, addresses *specifically* marked as DATA/GFX/PGFX
// However, addresses *specifically* marked as DATA/GFX/PGFX/COL/PCOL/BCOL/AUD
// in the emulation core indicate that the CODE range has finished
// Therefore, we stop at the first such address encountered
for (uInt32 k = pcBeg; k <= myPCEnd; ++k) {

View File

@ -38,7 +38,7 @@ Cartridge::Cartridge(const Settings& settings, const string& md5)
for(uInt32 i = 0; i < 256; ++i)
myRWPRandomValues[i] = rand.next();
myRAMAccesses.reserve(5);
myRamReadAccesses.reserve(5);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -86,7 +86,7 @@ uInt8 Cartridge::peekRAM(uInt8& dest, uInt16 address)
if(!bankLocked() && !mySystem->autodetectMode())
{
// Record access here; final determination will happen in ::pokeRAM()
myRAMAccesses.push_back(address);
myRamReadAccesses.push_back(address);
dest = value;
}
#else
@ -100,11 +100,11 @@ uInt8 Cartridge::peekRAM(uInt8& dest, uInt16 address)
void Cartridge::pokeRAM(uInt8& dest, uInt16 address, uInt8 value)
{
#ifdef DEBUGGER_SUPPORT
for(auto i = myRAMAccesses.begin(); i != myRAMAccesses.end(); ++i)
for(auto i = myRamReadAccesses.begin(); i != myRamReadAccesses.end(); ++i)
{
if(*i == address)
{
myRAMAccesses.erase(i);
myRamReadAccesses.erase(i);
break;
}
}
@ -113,13 +113,13 @@ void Cartridge::pokeRAM(uInt8& dest, uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge::createCodeAccessBase(size_t size)
void Cartridge::createRomAccessBase(size_t size)
{
#ifdef DEBUGGER_SUPPORT
myCodeAccessBase = make_unique<Device::AccessFlags[]>(size);
std::fill_n(myCodeAccessBase.get(), size, Device::ROW);
myRomAccessBase = make_unique<Device::AccessFlags[]>(size);
std::fill_n(myRomAccessBase.get(), size, Device::ROW);
#else
myCodeAccessBase = nullptr;
myRomAccessBase = nullptr;
#endif
}

View File

@ -113,7 +113,7 @@ class Cartridge : public Device
Clears information about all accesses to cart RAM.
*/
void clearAllRAMAccesses() {
myRAMAccesses.clear();
myRamReadAccesses.clear();
myRamWriteAccess = 0;
}
@ -125,7 +125,7 @@ class Cartridge : public Device
@return Address of illegal access if one occurred, else 0
*/
uInt16 getIllegalRAMReadAccess() const {
return myRAMAccesses.size() > 0 ? myRAMAccesses[0] : 0;
return myRamReadAccesses.size() > 0 ? myRamReadAccesses[0] : 0;
}
/**
@ -274,7 +274,7 @@ class Cartridge : public Device
@param size The size of the code-access array to create
*/
void createCodeAccessBase(size_t size);
void createRomAccessBase(size_t size);
/**
Fill the given RAM array with (possibly random) data.
@ -322,8 +322,8 @@ class Cartridge : public Device
bool myBankChanged{true};
// The array containing information about every byte of ROM indicating
// whether it is used as code.
std::unique_ptr<Device::AccessFlags[]> myCodeAccessBase;
// whether it is used as code, data, graphics etc.
std::unique_ptr<Device::AccessFlags[]> myRomAccessBase;
// Contains address of illegal RAM write access or 0
uInt16 myRamWriteAccess{0};
@ -348,8 +348,10 @@ class Cartridge : public Device
// Used when we want the 'Cartridge.StartBank' ROM property
StartBankFromPropsFunc myStartBankFromPropsFunc;
// Contains
ShortArray myRAMAccesses;
// Used to answer whether an access in the last instruction cycle
// generated an illegal read RAM access. Contains address of illegal
// access.
ShortArray myRamReadAccesses;
// Following constructors and assignment operators not supported
Cartridge() = delete;

View File

@ -25,7 +25,7 @@ Cartridge0840::Cartridge0840(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -137,7 +137,7 @@ bool Cartridge0840::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -51,7 +51,7 @@ Cartridge2K::Cartridge2K(const ByteBuffer& image, size_t size,
mySize = System::PAGE_SIZE;
}
createCodeAccessBase(mySize);
createRomAccessBase(mySize);
// Set mask for accessing the image buffer
// This is guaranteed to work, as mySize is a power of two
@ -76,7 +76,7 @@ void Cartridge2K::install(System& system)
for(uInt16 addr = 0x1000; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[addr & myMask];
access.codeAccessBase = &myCodeAccessBase[addr & myMask];
access.romAccessBase = &myRomAccessBase[addr & myMask];
mySystem->setPageAccess(addr, access);
}
}

View File

@ -30,7 +30,7 @@ Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get(), mySize, myImage.get());
createCodeAccessBase(mySize + myRAM.size());
createRomAccessBase(mySize + myRAM.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -59,7 +59,7 @@ void Cartridge3E::install(System& system)
for(uInt16 addr = 0x1800; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[(mySize - 2048) + (addr & 0x07FF)];
access.codeAccessBase = &myCodeAccessBase[(mySize - 2048) + (addr & 0x07FF)];
access.romAccessBase = &myRomAccessBase[(mySize - 2048) + (addr & 0x07FF)];
mySystem->setPageAccess(addr, access);
}
@ -158,7 +158,7 @@ bool Cartridge3E::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x1800; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[offset + (addr & 0x07FF)];
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x07FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x07FF)];
mySystem->setPageAccess(addr, access);
}
}
@ -177,7 +177,7 @@ bool Cartridge3E::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x1400; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[offset + (addr & 0x03FF)];
access.codeAccessBase = &myCodeAccessBase[mySize + offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[mySize + offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
@ -189,7 +189,7 @@ bool Cartridge3E::bank(uInt16 bank)
// check if RWP happens
for(uInt16 addr = 0x1400; addr < 0x1800; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[mySize + offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[mySize + offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
}

View File

@ -30,7 +30,7 @@ Cartridge3EPlus::Cartridge3EPlus(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get(), mySize, myImage.get());
createCodeAccessBase(mySize + myRAM.size());
createRomAccessBase(mySize + myRAM.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -214,7 +214,7 @@ void Cartridge3EPlus::bankRAMSlot(uInt16 bank)
if(!upper)
access.directPeekBase = &myRAM[startCurrentBank + (addr & (RAM_BANK_SIZE - 1))];
access.codeAccessBase = &myCodeAccessBase[mySize + startCurrentBank + (addr & (RAM_BANK_SIZE - 1))];
access.romAccessBase = &myRomAccessBase[mySize + startCurrentBank + (addr & (RAM_BANK_SIZE - 1))];
mySystem->setPageAccess(addr, access);
}
}
@ -254,7 +254,7 @@ void Cartridge3EPlus::bankROMSlot(uInt16 bank)
for(uInt16 addr = start; addr <= end; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[startCurrentBank + (addr & (ROM_BANK_SIZE - 1))];
access.codeAccessBase = &myCodeAccessBase[startCurrentBank + (addr & (ROM_BANK_SIZE - 1))];
access.romAccessBase = &myRomAccessBase[startCurrentBank + (addr & (ROM_BANK_SIZE - 1))];
mySystem->setPageAccess(addr, access);
}
}

View File

@ -30,7 +30,7 @@ Cartridge3F::Cartridge3F(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get(), mySize, myImage.get());
createCodeAccessBase(mySize);
createRomAccessBase(mySize);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -57,7 +57,7 @@ void Cartridge3F::install(System& system)
for(uInt16 addr = 0x1800; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[(mySize - 2048) + (addr & 0x07FF)];
access.codeAccessBase = &myCodeAccessBase[(mySize - 2048) + (addr & 0x07FF)];
access.romAccessBase = &myRomAccessBase[(mySize - 2048) + (addr & 0x07FF)];
mySystem->setPageAccess(addr, access);
}
@ -117,7 +117,7 @@ bool Cartridge3F::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x1800; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[offset + (addr & 0x07FF)];
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x07FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x07FF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -34,14 +34,14 @@ Cartridge4A50::Cartridge4A50(const ByteBuffer& image, size_t size,
for(uInt32 slice = 0; slice < 128_KB / size; ++slice)
std::copy_n(image.get(), size, myImage.begin() + (slice*size));
// We use System::PageAccess.codeAccessBase, but don't allow its use
// We use System::PageAccess.romAccessBase, but don't allow its use
// through a pointer, since the address space of 4A50 carts can change
// at the instruction level, and PageAccess is normally defined at an
// interval of 64 bytes
//
// Instead, access will be through the getAccessFlags and setAccessFlags
// methods below
createCodeAccessBase(myImage.size() + myRAM.size());
createRomAccessBase(myImage.size() + myRAM.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -188,28 +188,28 @@ Device::AccessFlags Cartridge4A50::getAccessFlags(uInt16 address) const
if((address & 0x1800) == 0x1000) // 2K region from 0x1000 - 0x17ff
{
if(myIsRomLow)
return myCodeAccessBase[(address & 0x7ff) + mySliceLow];
return myRomAccessBase[(address & 0x7ff) + mySliceLow];
else
return myCodeAccessBase[131072 + (address & 0x7ff) + mySliceLow];
return myRomAccessBase[131072 + (address & 0x7ff) + mySliceLow];
}
else if(((address & 0x1fff) >= 0x1800) && // 1.5K region from 0x1800 - 0x1dff
((address & 0x1fff) <= 0x1dff))
{
if(myIsRomMiddle)
return myCodeAccessBase[(address & 0x7ff) + mySliceMiddle + 0x10000];
return myRomAccessBase[(address & 0x7ff) + mySliceMiddle + 0x10000];
else
return myCodeAccessBase[131072 + (address & 0x7ff) + mySliceMiddle];
return myRomAccessBase[131072 + (address & 0x7ff) + mySliceMiddle];
}
else if((address & 0x1f00) == 0x1e00) // 256B region from 0x1e00 - 0x1eff
{
if(myIsRomHigh)
return myCodeAccessBase[(address & 0xff) + mySliceHigh + 0x10000];
return myRomAccessBase[(address & 0xff) + mySliceHigh + 0x10000];
else
return myCodeAccessBase[131072 + (address & 0xff) + mySliceHigh];
return myRomAccessBase[131072 + (address & 0xff) + mySliceHigh];
}
else if((address & 0x1f00) == 0x1f00) // 256B region from 0x1f00 - 0x1fff
{
return myCodeAccessBase[(address & 0xff) + 0x1ff00];
return myRomAccessBase[(address & 0xff) + 0x1ff00];
}
return 0;
}
@ -220,28 +220,28 @@ void Cartridge4A50::setAccessFlags(uInt16 address, Device::AccessFlags flags)
if((address & 0x1800) == 0x1000) // 2K region from 0x1000 - 0x17ff
{
if(myIsRomLow)
myCodeAccessBase[(address & 0x7ff) + mySliceLow] |= flags;
myRomAccessBase[(address & 0x7ff) + mySliceLow] |= flags;
else
myCodeAccessBase[131072 + (address & 0x7ff) + mySliceLow] |= flags;
myRomAccessBase[131072 + (address & 0x7ff) + mySliceLow] |= flags;
}
else if(((address & 0x1fff) >= 0x1800) && // 1.5K region from 0x1800 - 0x1dff
((address & 0x1fff) <= 0x1dff))
{
if(myIsRomMiddle)
myCodeAccessBase[(address & 0x7ff) + mySliceMiddle + 0x10000] |= flags;
myRomAccessBase[(address & 0x7ff) + mySliceMiddle + 0x10000] |= flags;
else
myCodeAccessBase[131072 + (address & 0x7ff) + mySliceMiddle] |= flags;
myRomAccessBase[131072 + (address & 0x7ff) + mySliceMiddle] |= flags;
}
else if((address & 0x1f00) == 0x1e00) // 256B region from 0x1e00 - 0x1eff
{
if(myIsRomHigh)
myCodeAccessBase[(address & 0xff) + mySliceHigh + 0x10000] |= flags;
myRomAccessBase[(address & 0xff) + mySliceHigh + 0x10000] |= flags;
else
myCodeAccessBase[131072 + (address & 0xff) + mySliceHigh] |= flags;
myRomAccessBase[131072 + (address & 0xff) + mySliceHigh] |= flags;
}
else if((address & 0x1f00) == 0x1f00) // 256B region from 0x1f00 - 0x1fff
{
myCodeAccessBase[(address & 0xff) + 0x1ff00] |= flags;
myRomAccessBase[(address & 0xff) + 0x1ff00] |= flags;
}
}
#endif

View File

@ -25,7 +25,7 @@ Cartridge4K::Cartridge4K(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -46,7 +46,7 @@ void Cartridge4K::install(System& system)
for(uInt16 addr = 0x1000; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[addr & 0x0FFF];
access.codeAccessBase = &myCodeAccessBase[addr & 0x0FFF];
access.romAccessBase = &myRomAccessBase[addr & 0x0FFF];
mySystem->setPageAccess(addr, access);
}
}

View File

@ -25,7 +25,7 @@ Cartridge4KSC::Cartridge4KSC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -49,7 +49,7 @@ void Cartridge4KSC::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x007F];
access.romAccessBase = &myRomAccessBase[addr & 0x007F];
mySystem->setPageAccess(addr, access);
}
@ -58,7 +58,7 @@ void Cartridge4KSC::install(System& system)
for(uInt16 addr = 0x1080; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x007F];
access.codeAccessBase = &myCodeAccessBase[0x80 + (addr & 0x007F)];
access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)];
mySystem->setPageAccess(addr, access);
}
@ -66,7 +66,7 @@ void Cartridge4KSC::install(System& system)
for(uInt16 addr = 0x1100; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[addr & 0x0FFF];
access.codeAccessBase = &myCodeAccessBase[addr & 0x0FFF];
access.romAccessBase = &myRomAccessBase[addr & 0x0FFF];
mySystem->setPageAccess(addr, access);
}
}

View File

@ -35,13 +35,13 @@ CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size,
std::copy_n(ourDefaultHeader.data(), ourDefaultHeader.size(),
myLoadImages.get()+myImage.size());
// We use System::PageAccess.codeAccessBase, but don't allow its use
// We use System::PageAccess.romAccessBase, but don't allow its use
// through a pointer, since the AR scheme doesn't support bankswitching
// in the normal sense
//
// Instead, access will be through the getAccessFlags and setAccessFlags
// methods below
createCodeAccessBase(mySize);
createRomAccessBase(mySize);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -194,14 +194,14 @@ bool CartridgeAR::poke(uInt16 addr, uInt8)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Device::AccessFlags CartridgeAR::getAccessFlags(uInt16 address) const
{
return myCodeAccessBase[(address & 0x07FF) +
return myRomAccessBase[(address & 0x07FF) +
myImageOffset[(address & 0x0800) ? 1 : 0]];
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeAR::setAccessFlags(uInt16 address, Device::AccessFlags flags)
{
myCodeAccessBase[(address & 0x07FF) +
myRomAccessBase[(address & 0x07FF) +
myImageOffset[(address & 0x0800) ? 1 : 0]] |= flags;
}
#endif

View File

@ -25,7 +25,7 @@ CartridgeBF::CartridgeBF(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -88,7 +88,7 @@ bool CartridgeBF::bank(uInt16 bank)
for(uInt16 addr = (0x1F80 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -97,7 +97,7 @@ bool CartridgeBF::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeBFSC::CartridgeBFSC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,7 +51,7 @@ void CartridgeBFSC::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x007F];
access.romAccessBase = &myRomAccessBase[addr & 0x007F];
mySystem->setPageAccess(addr, access);
}
@ -60,7 +60,7 @@ void CartridgeBFSC::install(System& system)
for(uInt16 addr = 0x1080; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x007F];
access.codeAccessBase = &myCodeAccessBase[0x80 + (addr & 0x007F)];
access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)];
mySystem->setPageAccess(addr, access);
}
@ -127,7 +127,7 @@ bool CartridgeBFSC::bank(uInt16 bank)
for(uInt16 addr = (0x1F80 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -136,7 +136,7 @@ bool CartridgeBFSC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -49,7 +49,7 @@ CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size,
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
// Even though the ROM is 32K, only 28K is accessible to the 6507
createCodeAccessBase(28_KB);
createRomAccessBase(28_KB);
// Pointer to the program ROM (28K @ 0 byte offset)
// which starts after the 2K BUS Driver and 2K C Code
@ -442,7 +442,7 @@ bool CartridgeBUS::bank(uInt16 bank)
// Map Program ROM image into the system
for(uInt16 addr = 0x1040; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -65,7 +65,7 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size,
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
// even though the ROM is 32K, only 28K is accessible to the 6507
createCodeAccessBase(28_KB);
createRomAccessBase(28_KB);
// Pointer to the program ROM (28K @ 0 byte offset)
// which starts after the 2K CDF Driver and 2K C Code
@ -415,7 +415,7 @@ bool CartridgeCDF::bank(uInt16 bank)
// Map Program ROM image into the system
for(uInt16 addr = 0x1040; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -27,7 +27,7 @@ CartridgeCM::CartridgeCM(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -119,7 +119,7 @@ bool CartridgeCM::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x1800; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -131,12 +131,12 @@ bool CartridgeCM::bank(uInt16 bank)
if(mySWCHA & 0x10)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
}
else
{
access.directPeekBase = &myRAM[addr & 0x7FF];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x07FF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x07FF)];
}
if((mySWCHA & 0x30) == 0x20)

View File

@ -28,7 +28,7 @@ CartridgeCTY::CartridgeCTY(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
// Default to no tune data in case user is utilizing an old ROM
myTuneData.fill(0);
@ -240,7 +240,7 @@ bool CartridgeCTY::bank(uInt16 bank)
System::PageAccess access(this, System::PageAccessType::READ);
for(uInt16 addr = 0x1080; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -40,7 +40,7 @@ CartridgeCV::CartridgeCV(const ByteBuffer& image, size_t size,
// Copy the RAM image into a buffer for use in reset()
std::copy_n(image.get(), myInitialRAM.size(), myInitialRAM.begin());
}
createCodeAccessBase(myImage.size() + myRAM.size());
createRomAccessBase(myImage.size() + myRAM.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -68,7 +68,7 @@ void CartridgeCV::install(System& system)
for(uInt16 addr = 0x1800; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[addr & 0x07FF];
access.codeAccessBase = &myCodeAccessBase[addr & 0x07FF];
access.romAccessBase = &myRomAccessBase[addr & 0x07FF];
mySystem->setPageAccess(addr, access);
}
@ -76,7 +76,7 @@ void CartridgeCV::install(System& system)
// Map access to this class, since we need to inspect all accesses to
// check if RWP happens
access.directPeekBase = nullptr;
access.codeAccessBase = nullptr;
access.romAccessBase = nullptr;
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1400; addr < 0x1800; addr += System::PAGE_SIZE)
mySystem->setPageAccess(addr, access);
@ -87,7 +87,7 @@ void CartridgeCV::install(System& system)
for(uInt16 addr = 0x1000; addr < 0x1400; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x03FF];
access.codeAccessBase = &myCodeAccessBase[2048 + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[2048 + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
}

View File

@ -30,7 +30,7 @@ CartridgeCVPlus::CartridgeCVPlus(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get(), mySize, myImage.get());
createCodeAccessBase(mySize + myRAM.size());
createRomAccessBase(mySize + myRAM.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -58,11 +58,11 @@ void CartridgeCVPlus::install(System& system)
// Map access to this class, since we need to inspect all accesses to
// check if RWP happens
access.directPeekBase = access.directPokeBase = nullptr;
access.codeAccessBase = nullptr;
access.romAccessBase = nullptr;
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1400; addr < 0x1800; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[mySize + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[mySize + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
@ -71,7 +71,7 @@ void CartridgeCVPlus::install(System& system)
for(uInt16 addr = 0x1000; addr < 0x1400; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x03FF];
access.codeAccessBase = &myCodeAccessBase[mySize + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[mySize + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
@ -148,7 +148,7 @@ bool CartridgeCVPlus::bank(uInt16 bank)
for(uInt16 addr = 0x1800; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[offset + (addr & 0x07FF)];
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x07FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x07FF)];
mySystem->setPageAccess(addr, access);
}

View File

@ -30,7 +30,7 @@ CartridgeDASH::CartridgeDASH(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get(), mySize, myImage.get());
createCodeAccessBase(mySize + myRAM.size());
createRomAccessBase(mySize + myRAM.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -204,7 +204,7 @@ void CartridgeDASH::bankRAMSlot(uInt16 bank)
if(!upper)
access.directPeekBase = &myRAM[startCurrentBank + (addr & (RAM_BANK_SIZE - 1))];
access.codeAccessBase = &myCodeAccessBase[mySize + startCurrentBank + (addr & (RAM_BANK_SIZE - 1))];
access.romAccessBase = &myRomAccessBase[mySize + startCurrentBank + (addr & (RAM_BANK_SIZE - 1))];
mySystem->setPageAccess(addr, access);
}
}
@ -247,7 +247,7 @@ void CartridgeDASH::bankROMSlot(uInt16 bank)
for (uInt16 addr = start; addr <= end; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[startCurrentBank + (addr & (ROM_BANK_SIZE - 1))];
access.codeAccessBase = &myCodeAccessBase[startCurrentBank + (addr & (ROM_BANK_SIZE - 1))];
access.romAccessBase = &myRomAccessBase[startCurrentBank + (addr & (ROM_BANK_SIZE - 1))];
mySystem->setPageAccess(addr, access);
}
}

View File

@ -25,7 +25,7 @@ CartridgeDF::CartridgeDF(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -84,7 +84,7 @@ bool CartridgeDF::bank(uInt16 bank)
for(uInt16 addr = (0x1FC0 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -93,7 +93,7 @@ bool CartridgeDF::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeDFSC::CartridgeDFSC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,7 +51,7 @@ void CartridgeDFSC::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x007F];
access.romAccessBase = &myRomAccessBase[addr & 0x007F];
mySystem->setPageAccess(addr, access);
}
@ -60,7 +60,7 @@ void CartridgeDFSC::install(System& system)
for(uInt16 addr = 0x1080; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x007F];
access.codeAccessBase = &myCodeAccessBase[0x80 + (addr & 0x007F)];
access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)];
mySystem->setPageAccess(addr, access);
}
@ -127,7 +127,7 @@ bool CartridgeDFSC::bank(uInt16 bank)
for(uInt16 addr = (0x1FC0 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -136,7 +136,7 @@ bool CartridgeDFSC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -27,7 +27,7 @@ CartridgeDPC::CartridgeDPC(const ByteBuffer& image, size_t size,
{
// Make a copy of the entire image
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(8_KB);
createRomAccessBase(8_KB);
// Pointer to the program ROM (8K @ 0 byte offset)
myProgramImage = myImage.data();
@ -373,7 +373,7 @@ bool CartridgeDPC::bank(uInt16 bank)
for(uInt16 addr = (0x1FF8 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -382,7 +382,7 @@ bool CartridgeDPC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myProgramImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -36,7 +36,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size,
if(mySize < myImage.size())
myImage.fill(0);
std::copy_n(image.get(), size, myImage.begin() + (myImage.size() - mySize));
createCodeAccessBase(24_KB);
createRomAccessBase(24_KB);
// Pointer to the program ROM (24K @ 3K offset; ignore first 3K)
myProgramImage = myImage.data() + 3_KB;
@ -604,7 +604,7 @@ bool CartridgeDPCPlus::bank(uInt16 bank)
// Map Program ROM image into the system
for(uInt16 addr = 0x1080; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeE0::CartridgeE0(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -61,13 +61,13 @@ void CartridgeE0::install(System& system)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[0x1C00 + (addr & 0x03FF)];
access.codeAccessBase = &myCodeAccessBase[0x1C00 + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[0x1C00 + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
// Set the page accessing methods for the hot spots in the last segment
access.directPeekBase = nullptr;
access.codeAccessBase = &myCodeAccessBase[0x1FC0]; // TJ: is this the correct address (or 0x1FE0)?
access.romAccessBase = &myRomAccessBase[0x1FC0]; // TJ: is this the correct address (or 0x1FE0)?
access.type = System::PageAccessType::READ;
for(uInt16 addr = (0x1FE0 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
@ -144,7 +144,7 @@ void CartridgeE0::segmentZero(uInt16 slice)
for(uInt16 addr = 0x1000; addr < 0x1400; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[offset + (addr & 0x03FF)];
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
myBankChanged = true;
@ -165,7 +165,7 @@ void CartridgeE0::segmentOne(uInt16 slice)
for(uInt16 addr = 0x1400; addr < 0x1800; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[offset + (addr & 0x03FF)];
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
myBankChanged = true;
@ -186,7 +186,7 @@ void CartridgeE0::segmentTwo(uInt16 slice)
for(uInt16 addr = 0x1800; addr < 0x1C00; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[offset + (addr & 0x03FF)];
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeEF::CartridgeEF(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -84,7 +84,7 @@ bool CartridgeEF::bank(uInt16 bank)
for(uInt16 addr = (0x1FE0 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -93,7 +93,7 @@ bool CartridgeEF::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeEFSC::CartridgeEFSC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,7 +51,7 @@ void CartridgeEFSC::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x007F];
access.romAccessBase = &myRomAccessBase[addr & 0x007F];
mySystem->setPageAccess(addr, access);
}
@ -60,7 +60,7 @@ void CartridgeEFSC::install(System& system)
for(uInt16 addr = 0x1080; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x007F];
access.codeAccessBase = &myCodeAccessBase[0x80 + (addr & 0x007F)];
access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)];
mySystem->setPageAccess(addr, access);
}
@ -127,7 +127,7 @@ bool CartridgeEFSC::bank(uInt16 bank)
for(uInt16 addr = (0x1FE0 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -136,7 +136,7 @@ bool CartridgeEFSC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeF0::CartridgeF0(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -91,7 +91,7 @@ bool CartridgeF0::bank(uInt16 bank)
for(uInt16 addr = (0x1FF0 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -100,7 +100,7 @@ bool CartridgeF0::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}

View File

@ -26,7 +26,7 @@ CartridgeF4::CartridgeF4(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -88,7 +88,7 @@ bool CartridgeF4::bank(uInt16 bank)
for(uInt16 addr = (0x1FF4 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -97,7 +97,7 @@ bool CartridgeF4::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeF4SC::CartridgeF4SC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,7 +51,7 @@ void CartridgeF4SC::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x007F];
access.romAccessBase = &myRomAccessBase[addr & 0x007F];
mySystem->setPageAccess(addr, access);
}
@ -60,7 +60,7 @@ void CartridgeF4SC::install(System& system)
for(uInt16 addr = 0x1080; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x007F];
access.codeAccessBase = &myCodeAccessBase[0x80 + (addr & 0x007F)];
access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)];
mySystem->setPageAccess(addr, access);
}
@ -127,7 +127,7 @@ bool CartridgeF4SC::bank(uInt16 bank)
for(uInt16 addr = (0x1FF4 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -136,7 +136,7 @@ bool CartridgeF4SC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeF6::CartridgeF6(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -128,7 +128,7 @@ bool CartridgeF6::bank(uInt16 bank)
for(uInt16 addr = (0x1FF6 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -137,7 +137,7 @@ bool CartridgeF6::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeF6SC::CartridgeF6SC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,7 +51,7 @@ void CartridgeF6SC::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x007F];
access.romAccessBase = &myRomAccessBase[addr & 0x007F];
mySystem->setPageAccess(addr, access);
}
@ -60,7 +60,7 @@ void CartridgeF6SC::install(System& system)
for(uInt16 addr = 0x1080; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x007F];
access.codeAccessBase = &myCodeAccessBase[0x80 + (addr & 0x007F)];
access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)];
mySystem->setPageAccess(addr, access);
}
@ -167,7 +167,7 @@ bool CartridgeF6SC::bank(uInt16 bank)
for(uInt16 addr = (0x1FF6 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -176,7 +176,7 @@ bool CartridgeF6SC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeF8::CartridgeF8(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -109,7 +109,7 @@ bool CartridgeF8::bank(uInt16 bank)
for(uInt16 addr = (0x1FF8 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -118,7 +118,7 @@ bool CartridgeF8::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeF8SC::CartridgeF8SC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,7 +51,7 @@ void CartridgeF8SC::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1080; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x007F];
access.romAccessBase = &myRomAccessBase[addr & 0x007F];
mySystem->setPageAccess(addr, access);
}
@ -60,7 +60,7 @@ void CartridgeF8SC::install(System& system)
for(uInt16 addr = 0x1080; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x007F];
access.codeAccessBase = &myCodeAccessBase[0x80 + (addr & 0x007F)];
access.romAccessBase = &myRomAccessBase[0x80 + (addr & 0x007F)];
mySystem->setPageAccess(addr, access);
}
@ -147,7 +147,7 @@ bool CartridgeF8SC::bank(uInt16 bank)
for(uInt16 addr = (0x1FF8 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -156,7 +156,7 @@ bool CartridgeF8SC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -25,7 +25,7 @@ CartridgeFA::CartridgeFA(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,7 +51,7 @@ void CartridgeFA::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x00FF];
access.romAccessBase = &myRomAccessBase[addr & 0x00FF];
mySystem->setPageAccess(addr, access);
}
@ -60,7 +60,7 @@ void CartridgeFA::install(System& system)
for(uInt16 addr = 0x1100; addr < 0x1200; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x00FF];
access.codeAccessBase = &myCodeAccessBase[0x100 + (addr & 0x00FF)];
access.romAccessBase = &myRomAccessBase[0x100 + (addr & 0x00FF)];
mySystem->setPageAccess(addr, access);
}
@ -157,7 +157,7 @@ bool CartridgeFA::bank(uInt16 bank)
for(uInt16 addr = (0x1FF8 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -166,7 +166,7 @@ bool CartridgeFA::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -35,7 +35,7 @@ CartridgeFA2::CartridgeFA2(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(img_ptr, mySize, myImage.begin());
createCodeAccessBase(mySize);
createRomAccessBase(mySize);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -61,7 +61,7 @@ void CartridgeFA2::install(System& system)
access.type = System::PageAccessType::WRITE;
for(uInt16 addr = 0x1000; addr < 0x1100; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[addr & 0x00FF];
access.romAccessBase = &myRomAccessBase[addr & 0x00FF];
mySystem->setPageAccess(addr, access);
}
@ -71,7 +71,7 @@ void CartridgeFA2::install(System& system)
for(uInt16 addr = 0x1100; addr < 0x1200; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myRAM[addr & 0x00FF];
access.codeAccessBase = &myCodeAccessBase[0x100 + (addr & 0x00FF)];
access.romAccessBase = &myRomAccessBase[0x100 + (addr & 0x00FF)];
mySystem->setPageAccess(addr, access);
}
@ -222,7 +222,7 @@ bool CartridgeFA2::bank(uInt16 bank)
for(uInt16 addr = (0x1FF4 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -231,7 +231,7 @@ bool CartridgeFA2::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -26,7 +26,7 @@ CartridgeFC::CartridgeFC(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -113,7 +113,7 @@ bool CartridgeFC::bank(uInt16 bank)
for (uInt16 addr = (0x1FF8 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
@ -122,7 +122,7 @@ bool CartridgeFC::bank(uInt16 bank)
addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
myCurrentBank = myTargetBank;

View File

@ -26,7 +26,7 @@ CartridgeFE::CartridgeFE(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -29,7 +29,7 @@ CartridgeMDM::CartridgeMDM(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get(), mySize, myImage.get());
createCodeAccessBase(mySize);
createRomAccessBase(mySize);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -111,7 +111,7 @@ bool CartridgeMDM::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}

View File

@ -34,7 +34,7 @@ void CartridgeMNetwork::initialize(const ByteBuffer& image, size_t size)
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min<size_t>(romSize(), size), myImage.get());
createCodeAccessBase(romSize() + myRAM.size());
createRomAccessBase(romSize() + myRAM.size());
myRAMSlice = bankCount() - 1;
}
@ -70,7 +70,7 @@ void CartridgeMNetwork::setAccess(uInt16 addrFrom, uInt16 size,
access.directPeekBase = &directData[directOffset + (addr & addrMask)];
else if(type == System::PageAccessType::WRITE) // all RAM writes mapped to ::poke()
access.directPokeBase = nullptr;
access.codeAccessBase = &myCodeAccessBase[codeOffset + (addr & addrMask)];
access.romAccessBase = &myRomAccessBase[codeOffset + (addr & addrMask)];
mySystem->setPageAccess(addr, access);
}
}
@ -86,7 +86,7 @@ void CartridgeMNetwork::install(System& system)
for(uInt16 addr = (0x1FE0 & ~System::PAGE_MASK); addr < 0x2000;
addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[0x1fc0];
access.romAccessBase = &myRomAccessBase[0x1fc0];
mySystem->setPageAccess(addr, access);
}
/*setAccess(0x1FE0 & ~System::PAGE_MASK, System::PAGE_SIZE,

View File

@ -29,7 +29,7 @@ CartridgeSB::CartridgeSB(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get(), mySize, myImage.get());
createCodeAccessBase(mySize);
createRomAccessBase(mySize);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -121,7 +121,7 @@ bool CartridgeSB::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -27,7 +27,7 @@ CartridgeUA::CartridgeUA(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -135,7 +135,7 @@ bool CartridgeUA::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[myBankOffset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[myBankOffset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[myBankOffset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -37,7 +37,7 @@ CartridgeWD::CartridgeWD(const ByteBuffer& image, size_t size,
}
else
std::copy_n(image.get(), mySize, myImage.begin());
createCodeAccessBase(8_KB);
createRomAccessBase(8_KB);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -63,7 +63,7 @@ void CartridgeWD::install(System& system)
for(uInt16 addr = 0x1000; addr < 0x1040; addr += System::PAGE_SIZE)
{
read.directPeekBase = &myRAM[addr & 0x003F];
read.codeAccessBase = &myCodeAccessBase[addr & 0x003F];
read.romAccessBase = &myRomAccessBase[addr & 0x003F];
mySystem->setPageAccess(addr, read);
}
@ -73,7 +73,7 @@ void CartridgeWD::install(System& system)
System::PageAccess write(this, System::PageAccessType::WRITE);
for(uInt16 addr = 0x1040; addr < 0x1080; addr += System::PAGE_SIZE)
{
write.codeAccessBase = &myCodeAccessBase[addr & 0x003F];
write.romAccessBase = &myRomAccessBase[addr & 0x003F];
mySystem->setPageAccess(addr, write);
}
@ -177,7 +177,7 @@ void CartridgeWD::segmentZero(uInt8 slice)
// Skip first 128 bytes; it is always RAM
for(uInt16 addr = 0x1080; addr < 0x1400; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
myOffset[0] = offset;
@ -191,7 +191,7 @@ void CartridgeWD::segmentOne(uInt8 slice)
for(uInt16 addr = 0x1400; addr < 0x1800; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
myOffset[1] = offset;
@ -205,7 +205,7 @@ void CartridgeWD::segmentTwo(uInt8 slice)
for(uInt16 addr = 0x1800; addr < 0x1C00; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
myOffset[2] = offset;
@ -225,7 +225,7 @@ void CartridgeWD::segmentThree(uInt8 slice)
for(uInt16 addr = 0x1C00; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x03FF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x03FF)];
mySystem->setPageAccess(addr, access);
}
myOffset[3] = offset;

View File

@ -27,7 +27,7 @@ CartridgeX07::CartridgeX07(const ByteBuffer& image, size_t size,
{
// Copy the ROM image into my buffer
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
createCodeAccessBase(myImage.size());
createRomAccessBase(myImage.size());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -115,7 +115,7 @@ bool CartridgeX07::bank(uInt16 bank)
for(uInt16 addr = 0x1000; addr < 0x2000; addr += System::PAGE_SIZE)
{
access.directPeekBase = &myImage[offset + (addr & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[offset + (addr & 0x0FFF)];
access.romAccessBase = &myRomAccessBase[offset + (addr & 0x0FFF)];
mySystem->setPageAccess(addr, access);
}
return myBankChanged = true;

View File

@ -105,8 +105,8 @@ uInt8 System::peek(uInt16 addr, Device::AccessFlags flags)
#ifdef DEBUGGER_SUPPORT
// Set access type
if(access.codeAccessBase)
*(access.codeAccessBase + (addr & PAGE_MASK)) |= flags;
if(access.romAccessBase)
*(access.romAccessBase + (addr & PAGE_MASK)) |= flags;
else
access.device->setAccessFlags(addr, flags);
#endif
@ -134,8 +134,8 @@ void System::poke(uInt16 addr, uInt8 value, Device::AccessFlags flags)
#ifdef DEBUGGER_SUPPORT
// Set access type
if (access.codeAccessBase)
*(access.codeAccessBase + (addr & PAGE_MASK)) |= flags;
if (access.romAccessBase)
*(access.romAccessBase + (addr & PAGE_MASK)) |= flags;
else
access.device->setAccessFlags(addr, flags);
#endif
@ -165,8 +165,8 @@ Device::AccessFlags System::getAccessFlags(uInt16 addr) const
{
const PageAccess& access = getPageAccess(addr);
if(access.codeAccessBase)
return *(access.codeAccessBase + (addr & PAGE_MASK));
if(access.romAccessBase)
return *(access.romAccessBase + (addr & PAGE_MASK));
else
return access.device->getAccessFlags(addr);
}
@ -176,8 +176,8 @@ void System::setAccessFlags(uInt16 addr, Device::AccessFlags flags)
{
const PageAccess& access = getPageAccess(addr);
if(access.codeAccessBase)
*(access.codeAccessBase + (addr & PAGE_MASK)) |= flags;
if(access.romAccessBase)
*(access.romAccessBase + (addr & PAGE_MASK)) |= flags;
else
access.device->setAccessFlags(addr, flags);
}

View File

@ -273,13 +273,17 @@ class System : public Serializable
uInt8* directPokeBase{nullptr};
/**
Pointer to a lookup table for marking an address as CODE. A CODE
section is defined as any address that appears in the program
Pointer to a lookup table for marking an address as CODE, DATA, GFX,
COL etc.
A CODE section is defined as any address that appears in the program
counter. Currently, this is used by the debugger/disassembler to
conclusively determine if a section of address space is CODE, even
if the disassembler failed to mark it as such.
A DATA, GFX, COL etc. section is defined as any ROM address from which
data is read. This is used by the debugger/disassembler to format
address sections accordingly.
*/
Device::AccessFlags* codeAccessBase{nullptr};
Device::AccessFlags* romAccessBase{nullptr};
/**
Pointer to the device associated with this page or to the system's