renamed bank locked into hotspots locked

This commit is contained in:
Thomas Jentzsch 2021-10-16 17:30:39 +02:00
parent f5a29714a6
commit 6657f9de64
30 changed files with 67 additions and 67 deletions

View File

@ -1090,15 +1090,15 @@ string CartDebug::saveDisassembly(string path)
uInt16 oldBank = myConsole.cartridge().getBank();
// prepare for switching banks
myConsole.cartridge().unlockBank();
myConsole.cartridge().unlockHotspots();
uInt32 origin = 0;
for(int bank = 0; bank < romBankCount; ++bank)
{
// TODO: not every CartDebugWidget does it like that, we need a method
myConsole.cartridge().unlockBank();
myConsole.cartridge().unlockHotspots();
myConsole.cartridge().bank(bank);
myConsole.cartridge().lockBank();
myConsole.cartridge().lockHotspots();
BankInfo& info = myBankInfo[bank];
@ -1196,9 +1196,9 @@ string CartDebug::saveDisassembly(string path)
buf << "\n";
}
}
myConsole.cartridge().unlockBank();
myConsole.cartridge().unlockHotspots();
myConsole.cartridge().bank(oldBank);
myConsole.cartridge().lockBank();
myConsole.cartridge().lockHotspots();
// Some boilerplate, similar to what DiStella adds
auto timeinfo = BSPF::localTime();

View File

@ -917,14 +917,14 @@ void Debugger::getCompletions(const char* in, StringList& list) const
void Debugger::lockSystem()
{
mySystem.lockDataBus();
myConsole.cartridge().lockBank();
myConsole.cartridge().lockHotspots();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::unlockSystem()
{
mySystem.unlockDataBus();
myConsole.cartridge().unlockBank();
myConsole.cartridge().unlockHotspots();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -174,14 +174,14 @@ void Cartridge3EPlusWidget::handleCommand(CommandSender* sender,
uInt8 bank = myBankWidgets[segment]->getSelected();
myCart.unlockBank();
myCart.unlockHotspots();
if(myBankType[segment]->getSelectedTag() == "ROM")
myCart.bank(bank, segment);
else
myCart.bank(bank + myCart.romBankCount(), segment);
myCart.lockBank();
myCart.lockHotspots();
invalidate();
updateUIState();
break;

View File

@ -151,9 +151,9 @@ void Cartridge3EWidget::handleCommand(CommandSender* sender, int cmd, int data,
myBankWidgets[0]->setSelectedIndex(0);
}
}
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(bank);
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}

View File

@ -169,7 +169,7 @@ void Cartridge4A50Widget::loadConfig()
void Cartridge4A50Widget::handleCommand(CommandSender* sender,
int cmd, int data, int id)
{
myCart.unlockBank();
myCart.unlockHotspots();
switch(cmd)
{
@ -261,7 +261,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
break;
}
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}

View File

@ -98,9 +98,9 @@ void CartridgeARWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(myBank->getSelected());
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
}

View File

@ -380,9 +380,9 @@ void CartridgeBUSWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(myBank->getSelected());
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
else

View File

@ -393,9 +393,9 @@ void CartridgeCDFWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(myBank->getSelected());
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
else

View File

@ -210,11 +210,11 @@ void CartridgeCMWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.mySWCHA &= 0xFC;
myCart.mySWCHA |= myBank->getSelected();
myCart.bank(myCart.mySWCHA & 0x03);
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
}

View File

@ -81,9 +81,9 @@ void CartridgeCTYWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(myBank->getSelected()+1);
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
}

View File

@ -321,9 +321,9 @@ void CartridgeDPCPlusWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(myBank->getSelected());
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
else

View File

@ -216,9 +216,9 @@ void CartridgeDPCWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(myBank->getSelected());
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
}

View File

@ -116,7 +116,7 @@ void CartridgeE7Widget::loadConfig()
void CartridgeE7Widget::handleCommand(CommandSender* sender,
int cmd, int data, int id)
{
myCart.unlockBank();
myCart.unlockHotspots();
switch(cmd)
{
@ -130,7 +130,7 @@ void CartridgeE7Widget::handleCommand(CommandSender* sender,
break;
}
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}

View File

@ -297,9 +297,9 @@ void CartridgeEnhancedWidget::handleCommand(CommandSender* sender,
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.unlockHotspots();
myCart.bank(myBankWidgets[id]->getSelected(), id);
myCart.lockBank();
myCart.lockHotspots();
invalidate();
}
}

View File

@ -100,7 +100,7 @@ uInt8 Cartridge::peekRAM(uInt8& dest, uInt16 address)
// Reading from the write port triggers an unwanted write
// But this only happens when in normal emulation mode
#ifdef DEBUGGER_SUPPORT
if(!bankLocked() && !mySystem->autodetectMode())
if(!hotspotsLocked() && !mySystem->autodetectMode())
{
// Record access here; final determination will happen in ::pokeRAM()
myRamReadAccesses.push_back(address);

View File

@ -83,13 +83,13 @@ class Cartridge : public Device
bool saveROM(const FilesystemNode& out) const;
/**
Lock/unlock bankswitching capability. The debugger will lock
the banks before querying the cart state, otherwise reading values
could inadvertantly cause a bankswitch to occur.
Lock/unlock bankswitching and other hotspot capabilities. The debugger
will lock the hotspots before querying the cart state, otherwise reading
values could inadvertantly cause e.g. a bankswitch to occur.
*/
void lockBank() { myBankLocked = true; }
void unlockBank() { myBankLocked = false; }
bool bankLocked() const { return myBankLocked; }
void lockHotspots() { myHotspotsLocked = true; }
void unlockHotspots() { myHotspotsLocked = false; }
bool hotspotsLocked() const { return myHotspotsLocked; }
/**
Get the default startup bank for a cart. This is the bank where
@ -420,9 +420,9 @@ class Cartridge : public Device
// The startup bank to use (where to look for the reset vector address)
uInt16 myStartBank{0};
// If myBankLocked is true, ignore attempts at bankswitching. This is used
// If myHotspotsLocked is true, ignore attempts at bankswitching. This is used
// by the debugger, when disassembling/dumping ROM.
bool myBankLocked{false};
bool myHotspotsLocked{false};
// Semi-random values to use when a read from write port occurs
std::array<uInt8, 256> myRWPRandomValues;

View File

@ -112,7 +112,7 @@ uInt8 Cartridge4A50::peek(uInt16 address)
else if((address & 0x1f00) == 0x1f00) // 256B region from 0x1f00 - 0x1fff
{
value = myImage[(address & 0xff) + 0x1ff00];
if(!bankLocked() && ((myLastData & 0xe0) == 0x60) &&
if(!hotspotsLocked() && ((myLastData & 0xe0) == 0x60) &&
((myLastAddress >= 0x1000) || (myLastAddress < 0x200)))
mySliceHigh = (mySliceHigh & 0xf0ff) | ((address & 0x8) << 8) |
((address & 0x70) << 4);
@ -167,7 +167,7 @@ bool Cartridge4A50::poke(uInt16 address, uInt8 value)
}
else if((address & 0x1f00) == 0x1f00) // 256B region at 0x1f00 - 0x1fff
{
if(!bankLocked() && ((myLastData & 0xe0) == 0x60) &&
if(!hotspotsLocked() && ((myLastData & 0xe0) == 0x60) &&
((myLastAddress >= 0x1000) || (myLastAddress < 0x200)))
{
mySliceHigh = (mySliceHigh & 0xf0ff) | ((address & 0x8) << 8) |
@ -250,7 +250,7 @@ void Cartridge4A50::setAccessFlags(uInt16 address, Device::AccessFlags flags)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge4A50::checkBankSwitch(uInt16 address, uInt8 value)
{
if(bankLocked()) return;
if(hotspotsLocked()) return;
// This scheme contains so many hotspots that it's easier to just check
// all of them

View File

@ -87,7 +87,7 @@ uInt8 CartridgeAR::peek(uInt16 addr)
{
// In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart
if(bankLocked())
if(hotspotsLocked())
return myImage[(addr & 0x07FF) + myImageOffset[(addr & 0x0800) ? 1 : 0]];
// Is the "dummy" SC BIOS hotspot for reading a load being accessed?
@ -354,7 +354,7 @@ void CartridgeAR::loadIntoRAM(uInt8 load)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeAR::bank(uInt16 bank, uInt16)
{
if(!bankLocked())
if(!hotspotsLocked())
return bankConfiguration(uInt8(bank));
else
return false;

View File

@ -202,7 +202,7 @@ uInt8 CartridgeBUS::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart
if(bankLocked())
if(hotspotsLocked())
return peekvalue;
// implement JMP FASTJMP which fetches the destination address from stream 17
@ -434,7 +434,7 @@ bool CartridgeBUS::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeBUS::bank(uInt16 bank, uInt16)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
// Remember what bank we're in
myBankOffset = bank << 12;

View File

@ -233,7 +233,7 @@ uInt8 CartridgeCDF::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart
if(bankLocked())
if(hotspotsLocked())
return peekvalue;
// implement JMP FASTJMP which fetches the destination address from stream 33
@ -453,7 +453,7 @@ bool CartridgeCDF::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCDF::bank(uInt16 bank, uInt16)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
// Remember what bank we're in
myBankOffset = bank << 12;

View File

@ -101,7 +101,7 @@ uInt8 CartridgeCM::column() const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::bank(uInt16 bank, uInt16)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
// Remember what bank we're in
myBankOffset = bank << 12;

View File

@ -103,7 +103,7 @@ uInt8 CartridgeCTY::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart
if(bankLocked())
if(hotspotsLocked())
return peekValue;
// Check for aliasing to 'LDA #$F2'
@ -248,7 +248,7 @@ bool CartridgeCTY::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCTY::bank(uInt16 bank, uInt16)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
// Remember what bank we're in
myBankOffset = bank << 12;
@ -382,7 +382,7 @@ uInt8 CartridgeCTY::ramReadWrite()
1 s for write).
*/
if(bankLocked()) return 0xff;
if(hotspotsLocked()) return 0xff;
// First access sets the timer
if(myRamAccessTimeout == 0)

View File

@ -143,7 +143,7 @@ uInt8 CartridgeDPC::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart
if(bankLocked())
if(hotspotsLocked())
return myImage[myCurrentSegOffset[0] + address];

View File

@ -240,7 +240,7 @@ uInt8 CartridgeDPCPlus::peek(uInt16 address)
// In debugger/bank-locked mode, we ignore all hotspots and in general
// anything that can change the internal state of the cart
if(bankLocked())
if(hotspotsLocked())
return peekvalue;
// Check if we're in Fast Fetch mode and the prior byte was an A9 (LDA #value)
@ -614,7 +614,7 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeDPCPlus::bank(uInt16 bank, uInt16)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
// Remember what bank we're in
myBankOffset = bank << 12;

View File

@ -212,7 +212,7 @@ bool CartridgeE7::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE7::bankRAM(uInt16 bank)
{
if(bankLocked()) return;
if(hotspotsLocked()) return;
// Remember what bank we're in
myCurrentRAM = bank;
@ -230,7 +230,7 @@ void CartridgeE7::bankRAM(uInt16 bank)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeE7::bank(uInt16 bank, uInt16)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
// Remember what bank we're in
myCurrentBank[0] = bank;

View File

@ -234,7 +234,7 @@ bool CartridgeEnhanced::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
const uInt16 segmentOffset = segment << myBankShift;

View File

@ -57,7 +57,7 @@ uInt8 CartridgeFA2::peek(uInt16 address)
if((address & ROM_MASK) == 0x0FF4)
{
// Load/save RAM to/from Harmony cart flash
if(mySize == 28_KB && !bankLocked())
if(mySize == 28_KB && !hotspotsLocked())
return ramReadWrite();
}
@ -70,7 +70,7 @@ bool CartridgeFA2::poke(uInt16 address, uInt8 value)
if((address & ROM_MASK) == 0x0FF4)
{
// Load/save RAM to/from Harmony cart flash
if(mySize == 28_KB && !bankLocked())
if(mySize == 28_KB && !hotspotsLocked())
ramReadWrite();
return false;
}

View File

@ -92,7 +92,7 @@ bool CartridgeMDM::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeMDM::bank(uInt16 bank, uInt16)
{
if(bankLocked() || myBankingDisabled) return false;
if(hotspotsLocked() || myBankingDisabled) return false;
CartridgeEnhanced::bank(bank);

View File

@ -70,7 +70,7 @@ void CartridgeWD::install(System& system)
uInt8 CartridgeWD::peek(uInt16 address)
{
// Is it time to do an actual bankswitch?
if(myPendingBank != 0xF0 && !bankLocked() &&
if(myPendingBank != 0xF0 && !hotspotsLocked() &&
mySystem->cycles() > (myCyclesAtBankswitchInit + 3))
{
bank(myPendingBank);
@ -82,7 +82,7 @@ uInt8 CartridgeWD::peek(uInt16 address)
// Hotspots at $30 - $3F
// Note that a hotspot read triggers a bankswitch after at least 3 cycles
// have passed, so we only initiate the switch here
if(!bankLocked() && (address & 0x00FF) >= 0x30 && (address & 0x00FF) <= 0x3F)
if(!hotspotsLocked() && (address & 0x00FF) >= 0x30 && (address & 0x00FF) <= 0x3F)
{
myCyclesAtBankswitchInit = mySystem->cycles();
myPendingBank = address & 0x000F;
@ -105,7 +105,7 @@ bool CartridgeWD::poke(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeWD::bank(uInt16 bank, uInt16)
{
if(bankLocked()) return false;
if(hotspotsLocked()) return false;
myCurrentBank = bank % romBankCount();

View File

@ -230,7 +230,7 @@ bool PlusROM::initialize(const ByteBuffer& image, size_t size)
bool PlusROM::peekHotspot(uInt16 address, uInt8& value)
{
#if defined(HTTP_LIB_SUPPORT)
if(myCart.bankLocked()) return false;
if(myCart.hotspotsLocked()) return false;
switch(address & 0x1FFF)
{
@ -265,7 +265,7 @@ bool PlusROM::peekHotspot(uInt16 address, uInt8& value)
bool PlusROM::pokeHotspot(uInt16 address, uInt8 value)
{
#if defined(HTTP_LIB_SUPPORT)
if(myCart.bankLocked()) return false;
if(myCart.hotspotsLocked()) return false;
switch(address & 0x1FFF)
{