mirror of https://github.com/stella-emu/stella.git
Re-disassemble and reset the start vector in the debugger if the disassembly
doesn't result in the PC being present. This fixes some bugs in the more esoteric bankswitch schemes, and also enables rewind to show the correct disassembled results. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1972 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
9c73d139de
commit
4ca87ba76b
|
@ -189,14 +189,15 @@ bool CartDebug::disassemble(const string& autocode, bool force)
|
|||
// Test current disassembly; don't re-disassemble if it hasn't changed
|
||||
// Also check if the current PC is in the current list
|
||||
uInt16 PC = myDebugger.cpuDebug().pc();
|
||||
int pcline = addressToLine(PC);
|
||||
bool changed = force || myConsole.cartridge().bankChanged() ||
|
||||
(addressToLine(PC) == -1);
|
||||
(pcline == -1);
|
||||
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)
|
||||
if(start == 0 || pcline == -1)
|
||||
start = myStartAddresses[getBank()] = PC;
|
||||
|
||||
// For now, DiStella can't handle address space below 0x1000
|
||||
|
@ -215,9 +216,9 @@ cerr << "current bank = " << getBank() << ", start bank = " << myConsole.cartrid
|
|||
// Check whether to use the 'autocode' functionality from Distella
|
||||
if(autocode == "0") // 'never'
|
||||
fillDisassemblyList(start, false, PC);
|
||||
else if(autocode == "1") // always
|
||||
else if(autocode == "1") // 'always'
|
||||
fillDisassemblyList(start, true, PC);
|
||||
else // automatic
|
||||
else // 'automatic'
|
||||
{
|
||||
// First try with autocode on, then turn off if PC isn't found
|
||||
if(!fillDisassemblyList(start, true, PC))
|
||||
|
|
Loading…
Reference in New Issue