Several big improvements to the debugger:

The disassembler now accepts a range of start addresses and remembers
old entry points, so the disassembly becomes more complete each time
the debugger is used.

Changes to address offsets within the same bank are now supported
(ie, changing from $fxxx to $dxxx within the same bank properly
updates the display).

Re-added ability to manually change banks from the debugger prompt
and the disassembly UI.  This now works correctly with the Distella
code.

Cleanup of the Cartridge::bank(...) API: if a bank cannot be changed,
the calling code will now know about it.  This fixes confusion with
some ROMs, whereby changing a bank in the debugger prompt would print
a success message even if the operation failed.

Note that these changes have broken rewind in the debugger.  Actually,
it only exposes problems that the rewind functionality already had :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2098 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-08-16 16:41:24 +00:00
parent 5a89e78fe2
commit d007c3502f
66 changed files with 257 additions and 153 deletions

View File

@ -36,11 +36,11 @@
* Several improvements to the debugger:
- user labels are now supported again
- 'runto' debugger command is now case-insensitive, and shows a
progressbar while searching through the disassembly
- the debugger window can be resized between ROM loads (previously,
the app had to be restarted)
- a vertical line separates the disassembly from the raw bytes
- 'runto' debugger command is now case-insensitive, and shows a
progressbar while searching through the disassembly
* Fixed behaviour of SWCHB and SWBCNT; pins set to output now remember
the values previously written. Some ROMs use this functionality for
@ -74,7 +74,7 @@
* Updated DPC+ bankswitch scheme to latest specifications.
* Snapshots taken in continuous snapshot mode are now timestamped, so
files are never overwritten.
older files are never overwritten.
* Fixed a TIA segfault that could occur with certain ROMs.

View File

@ -71,6 +71,15 @@ class Array
_data[_size++] = array._data[i];
}
void push_back_unique(const T& element)
{
if(!contains(element))
{
ensureCapacity(_size + 1);
_data[_size++] = element;
}
}
void insert_at(int idx, const T& element)
{
assert(idx >= 0 && idx <= _size);

View File

@ -37,13 +37,15 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const RamAreaList& areas)
for(RamAreaList::const_iterator i = areas.begin(); i != areas.end(); ++i)
addRamArea(i->start, i->size, i->roffset, i->woffset);
// We need a start address for each potential bank
myStartAddresses = new uInt16[myConsole.cartridge().bankCount()];
// Create an addresslist for each potential bank
for(int i = 0; i < myConsole.cartridge().bankCount(); ++i)
myStartAddresses[i] = 0;
{
AddressList l;
myEntryAddresses.push_back(l);
}
// We know the address for the startup bank right now
myStartAddresses[myConsole.cartridge().startBank()] = myDebugger.dpeek(0xfffc);
myEntryAddresses[myConsole.cartridge().startBank()].push_back(myDebugger.dpeek(0xfffc));
// Add system equates
for(uInt16 addr = 0x00; addr <= 0x0F; ++addr)
@ -61,7 +63,9 @@ CartDebug::~CartDebug()
myUserAddresses.clear();
mySystemAddresses.clear();
delete[] myStartAddresses;
for(uInt32 i = 0; i < myEntryAddresses.size(); ++i)
myEntryAddresses[i].clear();
myEntryAddresses.clear();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -199,11 +203,20 @@ bool CartDebug::disassemble(const string& resolvedata, bool force)
if(changed)
{
// Look at previous accesses to this bank to begin
// If no previous address exists, use the current program counter
uInt16 start = myStartAddresses[getBank()];
if(start == 0 || (pcline == -1 && (PC & 0x1000)))
start = myStartAddresses[getBank()] = PC;
AddressList& addresses = myEntryAddresses[getBank()];
// If the bank has changed, all old addresses must be 'converted'
// For example, if the list contains any $fxxx and the address space is now
// $bxxx, it must be changed
uInt16 offset = (PC - (PC % 0x1000));
for(uInt32 i = 0; i < addresses.size(); ++i)
addresses[i] = (addresses[i] & 0xFFF) + offset;
addresses.push_back_unique(PC);
uInt16 start = addresses[0];
if(pcline == -1 && (PC & 0x1000))
start = PC;
// For now, DiStella can't handle address space below 0x1000
// However, we want to disassemble at least once, otherwise carts
@ -221,14 +234,14 @@ bool CartDebug::disassemble(const string& resolvedata, bool force)
// Check whether to use the 'resolvedata' functionality from Distella
if(resolvedata == "never")
fillDisassemblyList(start, false, search);
fillDisassemblyList(addresses, false, search);
else if(resolvedata == "always")
fillDisassemblyList(start, true, search);
fillDisassemblyList(addresses, true, search);
else // 'auto'
{
// First try with resolvedata on, then turn off if PC isn't found
if(!fillDisassemblyList(start, true, search))
fillDisassemblyList(start, false, search);
if(!fillDisassemblyList(addresses, true, search))
fillDisassemblyList(addresses, false, search);
}
}
@ -236,13 +249,15 @@ bool CartDebug::disassemble(const string& resolvedata, bool force)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartDebug::fillDisassemblyList(uInt16 start, bool resolvedata, uInt16 search)
bool CartDebug::fillDisassemblyList(const AddressList& addresses,
bool resolvedata, uInt16 search)
{
bool found = false;
myDisassembly.list.clear();
myDisassembly.fieldwidth = 10 + myLabelLength;
DiStella distella(*this, myDisassembly.list, start, resolvedata);
cerr << "start (" << getBank() << "): ";
DiStella distella(*this, myDisassembly.list, addresses, resolvedata);
// Parts of the disassembly will be accessed later in different ways
// We place those parts in separate maps, to speed up access
@ -276,20 +291,23 @@ int CartDebug::addressToLine(uInt16 address) const
string CartDebug::disassemble(uInt16 start, uInt16 lines) const
{
Disassembly disasm;
DiStella distella(*this, disasm.list, start, false);
AddressList addresses;
addresses.push_back(start);
DiStella distella(*this, disasm.list, addresses, false);
// Fill the string with disassembled data
start &= 0xFFF;
ostringstream buffer;
// First find the lines in the range, and determine the longest string
uInt32 begin = 0, end = 0, length = 0;
for(end = 0; end < disasm.list.size() && lines > 0; ++end)
uInt32 list_size = disasm.list.size();
uInt32 begin = list_size, end = 0, length = 0;
for(end = 0; end < list_size && lines > 0; ++end)
{
const CartDebug::DisassemblyTag& tag = disasm.list[end];
if((tag.address & 0xfff) >= start)
{
if(begin == 0) begin = end;
if(begin == list_size) begin = end;
length = BSPF_max(length, (uInt32)tag.disasm.length());
--lines;
@ -303,7 +321,7 @@ string CartDebug::disassemble(uInt16 start, uInt16 lines) const
buffer << uppercase << hex << setw(4) << setfill('0') << tag.address
<< ": " << tag.disasm << setw(length - tag.disasm.length() + 1)
<< setfill(' ') << " "
<< tag.ccount << " " << tag.bytes << endl;
<< tag.ccount << " " << tag.bytes << endl;
}
return buffer.str();

View File

@ -30,6 +30,9 @@ class System;
#include "StringList.hxx"
#include "DebuggerSystem.hxx"
// Array of addresses
typedef Common::Array<uInt16> AddressList;
// pointer types for CartDebug instance methods
typedef int (CartDebug::*CARTDEBUG_INT_METHOD)();
@ -209,7 +212,8 @@ class CartDebug : public DebuggerSystem
// Actually call DiStella to fill the DisassemblyList structure
// Return whether the search address was actually in the list
bool fillDisassemblyList(uInt16 start, bool resolvedata, uInt16 search);
bool fillDisassemblyList(const AddressList& addresses,
bool resolvedata, uInt16 search);
// Extract labels and values from the given character stream
string extractLabel(char *c) const;
@ -219,10 +223,12 @@ class CartDebug : public DebuggerSystem
CartState myState;
CartState myOldState;
// A pointer to an array of start addresses for each bank in a cart
// A list of 'entry' addresses for each bank in a cart
// An entry address is the one at which time the debugger 'enters' the
// disassembler
// The startup bank will normally be 0xfffc, while the others are
// determined when the debugger is first opened
uInt16* myStartAddresses;
Common::Array<AddressList> myEntryAddresses;
// Used for the disassembly display, and mapping from addresses
// to corresponding lines of text in that display

View File

@ -80,10 +80,10 @@ static const char* builtin_functions[][3] = {
{ "_reset", "!(*SWCHB & $01)", "Game Reset pressed" },
{ "_color", "*SWCHB & $08", "Color/BW set to Color" },
{ "_bw", "!(*SWCHB & $08)", "Color/BW set to BW" },
{ "_diff0b", "!(*SWCHB & $40)", "Left difficulty set to B (easy)" },
{ "_diff0a", "*SWCHB & $40", "Left difficulty set to A (hard)" },
{ "_diff1b", "!(*SWCHB & $80)", "Right difficulty set to B (easy)" },
{ "_diff1a", "*SWCHB & $80", "Right difficulty set to A (hard)" },
{ "_diff0b", "!(*SWCHB & $40)", "Left diff. set to B (easy)" },
{ "_diff0a", "*SWCHB & $40", "Left diff. set to A (hard)" },
{ "_diff1b", "!(*SWCHB & $80)", "Right diff. set to B (easy)" },
{ "_diff1a", "*SWCHB & $80", "Right diff. set to A (hard)" },
// empty string marks end of list, do not remove
{ 0, 0, 0 }
@ -567,9 +567,9 @@ bool Debugger::setBank(int bank)
if(myConsole->cartridge().bankCount() > 1)
{
myConsole->cartridge().unlockBank();
myConsole->cartridge().bank(bank);
bool status = myConsole->cartridge().bank(bank);
myConsole->cartridge().lockBank();
return true;
return status;
}
return false;
}

View File

@ -626,6 +626,36 @@ void DebuggerParser::executeA()
debugger->cpuDebug().setA((uInt8)args[0]);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "bank"
void DebuggerParser::executeBank()
{
int banks = debugger->cartDebug().bankCount();
if(argCount == 0)
{
commandResult << debugger->cartDebug().getCartType() << ": ";
if(banks < 2)
commandResult << red("bankswitching not supported by this cartridge");
else
{
commandResult << "current = " << debugger->valueToString(debugger->cartDebug().getBank())
<< " out of " << debugger->valueToString(banks) << " banks";
}
}
else
{
if(banks == 1)
commandResult << red("bankswitching not supported by this cartridge");
else if(args[0] >= banks)
commandResult << red("invalid bank number (must be 0 to ")
<< debugger->valueToString(banks - 1) << ")";
else if(debugger->setBank(args[0]))
commandResult << "switched bank OK";
else
commandResult << red("error switching banks (bankswitching may not be supported)");
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "base"
void DebuggerParser::executeBase()
@ -1362,6 +1392,15 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
&DebuggerParser::executeA
},
{
"bank",
"Show # of banks, or switch to bank xx",
false,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeBank
},
{
"base",
"Set default base (hex, dec, or bin)",

View File

@ -83,7 +83,7 @@ class DebuggerParser
private:
enum {
kNumCommands = 56,
kNumCommands = 57,
kMAX_ARG_TYPES = 10
};
@ -135,6 +135,7 @@ class DebuggerParser
// List of available command methods
void executeA();
void executeBank();
void executeBase();
void executeBreak();
void executeBreakif();

View File

@ -23,7 +23,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
uInt16 start, bool resolvedata)
const AddressList& addresses, bool resolvedata)
: myDbg(dbg),
myList(list)
{
@ -53,9 +53,17 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
Offset to code = $D000
Code range = $D000-$DFFF
=============================================*/
if(addresses.size() == 0)
return;
uInt16 start = addresses[0];
myOffset = (start - (start % 0x1000));
myAddressQueue.push(start);
// Fill queue with start addresses (entry points into the ROM space)
for(uInt32 i = 0; i < addresses.size(); ++i)
{ cerr << hex << addresses[i] << " ";
myAddressQueue.push(addresses[i]);
} cerr << endl;
if(resolvedata)
{

View File

@ -48,11 +48,11 @@ class DiStella
@param dbg The CartDebug instance containing all label information
@param list The results of the disassembly are placed here
@param start The address at which to start disassembly
@param addresses The address(es) at which to start disassembly
@param resolvedata If enabled, try to determine code vs. data sections
*/
DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
uInt16 start, bool resolvedata = true);
const AddressList& addresses, bool resolvedata = true);
~DiStella();

View File

@ -28,6 +28,7 @@
#include "CpuDebug.hxx"
#include "GuiObject.hxx"
#include "InputTextDialog.hxx"
#include "DataGridWidget.hxx"
#include "EditTextWidget.hxx"
#include "PopUpWidget.hxx"
#include "StringList.hxx"
@ -50,26 +51,25 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
// Show current bank
xpos = x; ypos = y + 7;
ostringstream buf;
buf << "Current bank (" << dec
<< instance().debugger().cartDebug().bankCount() << " total):";
t = new StaticTextWidget(boss, font, xpos, ypos,
font.getStringWidth("Bank (current/total):"),
font.getStringWidth(buf.str()),
font.getFontHeight(),
"Bank (current/total):", kTextAlignLeft);
buf.str(), kTextAlignLeft);
xpos += t->getWidth() + 10;
myBank = new EditTextWidget(boss, font, xpos, ypos-2,
4 * font.getMaxCharWidth(),
font.getLineHeight(), "");
myBank->setEditable(false);
// Show number of banks
xpos += myBank->getWidth() + 5;
myBankCount =
new EditTextWidget(boss, font, xpos, ypos-2, 4 * font.getMaxCharWidth(),
font.getLineHeight(), "");
myBankCount->setEditable(false);
xpos += t->getWidth() + 5;
myBank = new DataGridWidget(boss, font, xpos, ypos-2,
1, 1, 4, 8, kBASE_10);
myBank->setTarget(this);
myBank->setRange(0, instance().debugger().cartDebug().bankCount());
if(instance().debugger().cartDebug().bankCount() <= 1)
myBank->setEditable(false);
addFocusWidget(myBank);
// 'resolvedata' setting for Distella
xpos += myBankCount->getWidth() + 20;
xpos += myBank->getWidth() + 20;
StringMap items;
items.push_back("Never", "never");
items.push_back("Always", "always");
@ -134,8 +134,7 @@ void RomWidget::loadConfig()
myRomList->setHighlighted(pcline);
// Set current bank and number of banks
myBank->setEditString(instance().debugger().valueToString(myCurrentBank, kBASE_10), bankChanged);
myBankCount->setEditString(instance().debugger().valueToString(cart.bankCount(), kBASE_10));
myBank->setList(-1, myCurrentBank, bankChanged);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -177,6 +176,10 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break;
}
case kDGItemDataChangedCmd:
setBank(myBank->getSelectedValue());
break;
case kResolveDataChanged:
instance().settings().setString("resolvedata", myResolveData->getSelectedTag());
invalidate();
@ -198,6 +201,14 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::setBank(uInt16 bank)
{
ostringstream command;
command << "bank #" << bank;
instance().debugger().run(command.str());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::setBreak(int disasm_line, bool state)
{

View File

@ -24,6 +24,7 @@
#define ROM_WIDGET_HXX
class GuiObject;
class DataGridWidget;
class EditTextWidget;
class InputTextDialog;
class PopUpWidget;
@ -47,6 +48,7 @@ class RomWidget : public Widget, public CommandSender
void loadConfig();
private:
void setBank(uInt16 bank);
void setBreak(int disasm_line, bool state);
void setPC(int disasm_line);
void runtoPC(int disasm_line);
@ -60,8 +62,7 @@ class RomWidget : public Widget, public CommandSender
};
RomListWidget* myRomList;
EditTextWidget* myBank;
EditTextWidget* myBankCount;
DataGridWidget* myBank;
PopUpWidget* myResolveData;
InputTextDialog* mySaveRom;

View File

@ -130,7 +130,7 @@ class Cartridge : public Device
/**
Set the specified bank.
*/
virtual void bank(uInt16 bank) = 0;
virtual bool bank(uInt16 bank) = 0;
/**
Get the current bank.

View File

@ -146,9 +146,9 @@ bool Cartridge0840::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge0840::bank(uInt16 bank)
bool Cartridge0840::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -167,7 +167,7 @@ void Cartridge0840::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -64,7 +64,7 @@ class Cartridge0840 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -101,9 +101,10 @@ bool Cartridge2K::poke(uInt16, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge2K::bank(uInt16 bank)
bool Cartridge2K::bank(uInt16 bank)
{
// Doesn't support bankswitching
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -68,7 +68,7 @@ class Cartridge2K : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -158,9 +158,9 @@ bool Cartridge3E::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge3E::bank(uInt16 bank)
bool Cartridge3E::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
if(bank < 256)
{
@ -225,7 +225,7 @@ void Cartridge3E::bank(uInt16 bank)
mySystem->setPageAccess(address >> shift, access);
}
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -96,7 +96,7 @@ class Cartridge3E : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -123,9 +123,9 @@ bool Cartridge3F::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge3F::bank(uInt16 bank)
bool Cartridge3F::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Make sure the bank they're asking for is reasonable
if(((uInt32)bank << 11) < mySize)
@ -154,7 +154,7 @@ void Cartridge3F::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x07FF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -73,7 +73,7 @@ class Cartridge3F : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -311,9 +311,10 @@ void Cartridge4A50::checkBankSwitch(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge4A50::bank(uInt16)
bool Cartridge4A50::bank(uInt16)
{
// Doesn't support bankswitching in the normal sense
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -81,7 +81,7 @@ class Cartridge4A50 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -78,9 +78,10 @@ bool Cartridge4K::poke(uInt16, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge4K::bank(uInt16)
bool Cartridge4K::bank(uInt16)
{
// Doesn't support bankswitching
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,7 +66,7 @@ class Cartridge4K : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -216,7 +216,7 @@ bool CartridgeAR::poke(uInt16 addr, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeAR::bankConfiguration(uInt8 configuration)
bool CartridgeAR::bankConfiguration(uInt8 configuration)
{
// D7-D5 of this byte: Write Pulse Delay (n/a for emulator)
//
@ -306,7 +306,7 @@ void CartridgeAR::bankConfiguration(uInt8 configuration)
break;
}
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -409,10 +409,12 @@ void CartridgeAR::loadIntoRAM(uInt8 load)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeAR::bank(uInt16 bank)
bool CartridgeAR::bank(uInt16 bank)
{
if(!bankLocked())
bankConfiguration(bank);
return bankConfiguration(bank);
else
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -82,7 +82,7 @@ class CartridgeAR : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.
@ -153,7 +153,7 @@ class CartridgeAR : public Cartridge
private:
// Handle a change to the bank configuration
void bankConfiguration(uInt8 configuration);
bool bankConfiguration(uInt8 configuration);
// Compute the sum of the array of bytes
uInt8 checksum(uInt8* s, uInt16 length);

View File

@ -149,9 +149,10 @@ bool CartridgeCV::poke(uInt16, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCV::bank(uInt16 bank)
bool CartridgeCV::bank(uInt16 bank)
{
// Doesn't support bankswitching
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -69,7 +69,7 @@ class CartridgeCV : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -416,9 +416,9 @@ bool CartridgeDPC::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPC::bank(uInt16 bank)
bool CartridgeDPC::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -439,7 +439,7 @@ void CartridgeDPC::bank(uInt16 bank)
access.directPeekBase = &myProgramImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -74,7 +74,7 @@ class CartridgeDPC : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -545,14 +545,14 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPCPlus::bank(uInt16 bank)
bool CartridgeDPCPlus::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -74,7 +74,7 @@ class CartridgeDPCPlus : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -200,9 +200,10 @@ void CartridgeE0::segmentTwo(uInt16 slice)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE0::bank(uInt16)
bool CartridgeE0::bank(uInt16)
{
// Doesn't support bankswitching in the normal sense
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -75,7 +75,7 @@ class CartridgeE0 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -199,9 +199,9 @@ void CartridgeE7::bankRAM(uInt16 bank)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE7::bank(uInt16 slice)
bool CartridgeE7::bank(uInt16 slice)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentSlice[0] = slice;
@ -245,7 +245,7 @@ void CartridgeE7::bank(uInt16 slice)
mySystem->setPageAccess(k >> shift, access);
}
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -92,7 +92,7 @@ class CartridgeE7 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -94,9 +94,9 @@ bool CartridgeEF::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEF::bank(uInt16 bank)
bool CartridgeEF::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -118,7 +118,7 @@ void CartridgeEF::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -70,7 +70,7 @@ class CartridgeEF : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -139,9 +139,9 @@ bool CartridgeEFSC::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEFSC::bank(uInt16 bank)
bool CartridgeEFSC::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -162,7 +162,7 @@ void CartridgeEFSC::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -70,7 +70,7 @@ class CartridgeEFSC : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -124,12 +124,14 @@ void CartridgeF0::incbank()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF0::bank(uInt16 bank)
bool CartridgeF0::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
myCurrentBank = bank - 1;
incbank();
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -67,7 +67,7 @@ class CartridgeF0 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -99,9 +99,9 @@ bool CartridgeF4::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF4::bank(uInt16 bank)
bool CartridgeF4::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -122,7 +122,7 @@ void CartridgeF4::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,7 +66,7 @@ class CartridgeF4 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -142,9 +142,9 @@ bool CartridgeF4SC::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF4SC::bank(uInt16 bank)
bool CartridgeF4SC::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -165,7 +165,7 @@ void CartridgeF4SC::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,7 +66,7 @@ class CartridgeF4SC : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -139,9 +139,9 @@ bool CartridgeF6::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF6::bank(uInt16 bank)
bool CartridgeF6::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -162,7 +162,7 @@ void CartridgeF6::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,7 +66,7 @@ class CartridgeF6 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -185,9 +185,9 @@ bool CartridgeF6SC::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF6SC::bank(uInt16 bank)
bool CartridgeF6SC::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -208,7 +208,7 @@ void CartridgeF6SC::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,7 +66,7 @@ class CartridgeF6SC : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -125,9 +125,9 @@ bool CartridgeF8::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF8::bank(uInt16 bank)
bool CartridgeF8::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -148,7 +148,7 @@ void CartridgeF8::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -67,7 +67,7 @@ class CartridgeF8 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -165,9 +165,9 @@ bool CartridgeF8SC::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF8SC::bank(uInt16 bank)
bool CartridgeF8SC::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -188,7 +188,7 @@ void CartridgeF8SC::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,7 +66,7 @@ class CartridgeF8SC : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -175,9 +175,9 @@ bool CartridgeFA::poke(uInt16 address, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeFA::bank(uInt16 bank)
bool CartridgeFA::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -198,7 +198,7 @@ void CartridgeFA::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,7 +66,7 @@ class CartridgeFA : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -83,9 +83,10 @@ bool CartridgeFE::poke(uInt16, uInt8)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeFE::bank(uInt16 b)
bool CartridgeFE::bank(uInt16)
{
// Doesn't support bankswitching in the normal sense
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -81,7 +81,7 @@ class CartridgeFE : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -210,9 +210,10 @@ bool CartridgeMC::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeMC::bank(uInt16 b)
bool CartridgeMC::bank(uInt16 b)
{
// Doesn't support bankswitching in the normal sense
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -173,7 +173,7 @@ class CartridgeMC : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -125,9 +125,9 @@ bool CartridgeSB::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeSB::bank(uInt16 bank)
bool CartridgeSB::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -146,7 +146,7 @@ void CartridgeSB::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -64,7 +64,7 @@ class CartridgeSB : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -134,9 +134,9 @@ bool CartridgeUA::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeUA::bank(uInt16 bank)
bool CartridgeUA::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
@ -155,7 +155,7 @@ void CartridgeUA::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -67,7 +67,7 @@ class CartridgeUA : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.

View File

@ -118,9 +118,9 @@ bool CartridgeX07::poke(uInt16 address, uInt8 value)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeX07::bank(uInt16 bank)
bool CartridgeX07::bank(uInt16 bank)
{
if(bankLocked()) return;
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = (bank & 0x0f);
@ -139,7 +139,7 @@ void CartridgeX07::bank(uInt16 bank)
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
myBankChanged = true;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -76,7 +76,7 @@ class CartridgeX07 : public Cartridge
@param bank The bank that should be installed in the system
*/
void bank(uInt16 bank);
bool bank(uInt16 bank);
/**
Get the current bank.