RomWidget now saves cart bankswitch state before disassembly and

restores it afterwards. Also, fixed the debugger "bank" command.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@827 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
urchlay 2005-10-13 00:59:30 +00:00
parent dbf97c41c6
commit 4233fa3ae4
2 changed files with 13 additions and 2 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Debugger.cxx,v 1.98 2005-10-12 03:32:28 urchlay Exp $
// $Id: Debugger.cxx,v 1.99 2005-10-13 00:59:30 urchlay Exp $
//============================================================================
#include "bspf.hxx"
@ -916,7 +916,9 @@ void Debugger::reloadROM() {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Debugger::setBank(int bank) {
if(myConsole->cartridge().bankCount() > 1) {
myConsole->cartridge().unlockBank();
myConsole->cartridge().bank(bank);
myConsole->cartridge().lockBank();
return true;
}
return false;
@ -953,6 +955,7 @@ void Debugger::saveOldState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::setStartState()
{
cerr << "Debugger::setStartState()" << endl;
// Lock the bus each time the debugger is entered, so we don't disturb anything
// mySystem->lockDataBus();
lockState();

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: RomWidget.cxx,v 1.9 2005-10-12 03:32:28 urchlay Exp $
// $Id: RomWidget.cxx,v 1.10 2005-10-13 00:59:30 urchlay Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -43,6 +43,8 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
mySourceAvailable(false),
myCurrentBank(-1)
{
cerr << "new RomWidget()" << endl;
int w = 58 * font.getMaxCharWidth(),
h = 31 * font.getLineHeight();
@ -160,6 +162,9 @@ void RomWidget::initialUpdate()
Debugger& dbg = instance()->debugger();
PackedBitArray* bp = dbg.breakpoints();
// Reading from ROM might trigger a bankswitch, so save the current bank
myCurrentBank = dbg.getBank();
// Fill romlist the current bank of source or disassembly
if(mySourceAvailable)
; // TODO - actually implement this
@ -189,6 +194,9 @@ void RomWidget::initialUpdate()
myRomList->setList(label, data, disasm, state);
}
// Restore the old bank, in case we inadvertently switched while reading.
dbg.setBank(myCurrentBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -