mirror of https://github.com/stella-emu/stella.git
Fixed debugger 'runto' command; it was case sensitive, so it never
matched anything most of the time. Also, as this operation can take a somewhat long time on slower systems, a progress bar is now shown. Fixed handling of bit 6 in VBLANK TIA register, which is related to how INPT4 and INPT5 are handled. This fixes at least one ROM that should have failed in Stella, but didn't. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2096 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
259e3091f0
commit
764e598536
14
Changes.txt
14
Changes.txt
|
@ -34,16 +34,22 @@
|
|||
now works exactly like an axis in UI mode (holding down a direction
|
||||
continues that direction until the hat is released/centered).
|
||||
|
||||
* Several improvements to the debugger. User labels are now supported
|
||||
again, the debugger window can be resized between ROM loads
|
||||
(previously, the app had to be restarted), and a vertical line
|
||||
separates the disassembly from the raw bytes.
|
||||
* Several improvements to the debugger:
|
||||
- user labels are now supported again
|
||||
- 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
|
||||
extra storage. Special thanks to Omegamatrix of AtariAge for advice
|
||||
and test ROMs in this area.
|
||||
|
||||
* Fixed bug in handling INPT4/INPT5 latches from VBLANK; a least one
|
||||
ROM was working in Stella when it didn't on real hardware.
|
||||
|
||||
* Added 'finishing touches' to some of the UI descriptions, giving a
|
||||
better explanation of the functions. Related to this, certain
|
||||
options now show a message box explaining the option in further
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
|
||||
// The following code should provide access to the standard C++ objects and
|
||||
// types: cout, cerr, string, ostream, istream, etc.
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
|
@ -122,6 +123,17 @@ inline bool BSPF_equalsIgnoreCase(const char* s1, const char* s2)
|
|||
return BSPF_strcasecmp(s1, s2) == 0;
|
||||
}
|
||||
|
||||
static bool BSPF_equalsIgnoreCaseChar(char ch1, char ch2)
|
||||
{
|
||||
return toupper((unsigned char)ch1) == toupper((unsigned char)ch2);
|
||||
}
|
||||
inline size_t BSPF_findIgnoreCase(const string& s1, const string& s2)
|
||||
{
|
||||
string::const_iterator pos = std::search(s1.begin(), s1.end(),
|
||||
s2.begin(), s2.end(), BSPF_equalsIgnoreCaseChar);
|
||||
return pos == s1.end() ? string::npos : pos - s1.begin();
|
||||
}
|
||||
|
||||
static const string EmptyString("");
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "Expression.hxx"
|
||||
#include "FSNode.hxx"
|
||||
#include "RomWidget.hxx"
|
||||
#include "ProgressDialog.hxx"
|
||||
|
||||
#ifdef CHEATCODE_SUPPORT
|
||||
#include "CheatManager.hxx"
|
||||
|
@ -1115,7 +1116,16 @@ void DebuggerParser::executeRunTo()
|
|||
const CartDebug& cartdbg = debugger->cartDebug();
|
||||
const CartDebug::DisassemblyList& list = cartdbg.disassembly().list;
|
||||
|
||||
uInt32 count = 0;
|
||||
uInt32 count = 0, max_iterations = list.size();
|
||||
|
||||
// Create a progress dialog box to show the progress searching through the
|
||||
// disassembly, since this may be a time-consuming operation
|
||||
ostringstream buf;
|
||||
buf << "RunTo searching through " << max_iterations << " disassembled instructions";
|
||||
ProgressDialog progress(debugger->myBaseDialog,
|
||||
debugger->getOSystem()->consoleFont(), buf.str());
|
||||
progress.setRange(0, max_iterations, 5);
|
||||
|
||||
bool done = false;
|
||||
do {
|
||||
debugger->step();
|
||||
|
@ -1125,10 +1135,13 @@ void DebuggerParser::executeRunTo()
|
|||
if(pcline >= 0)
|
||||
{
|
||||
const string& next = list[pcline].disasm;
|
||||
done = (next.find(argStrings[0]) != string::npos);
|
||||
done = (BSPF_findIgnoreCase(next, argStrings[0]) != string::npos);
|
||||
}
|
||||
++count;
|
||||
} while(!done && count < list.size());
|
||||
// Update the progress bar
|
||||
progress.setProgress(count);
|
||||
} while(!done && ++count < max_iterations);
|
||||
|
||||
progress.close();
|
||||
|
||||
if(done)
|
||||
commandResult
|
||||
|
|
|
@ -169,6 +169,7 @@ void TIA::reset()
|
|||
|
||||
myDumpEnabled = false;
|
||||
myDumpDisabledCycle = 0;
|
||||
myINPT4 = myINPT5 = 0x80;
|
||||
|
||||
// Should undriven pins be randomly driven high or low?
|
||||
myTIAPinsDriven = mySettings.getBool("tiadriven");
|
||||
|
@ -1241,14 +1242,22 @@ uInt8 TIA::peek(uInt16 addr)
|
|||
break;
|
||||
|
||||
case INPT4:
|
||||
value = (value & 0x7F) |
|
||||
(myConsole.controller(Controller::Left).read(Controller::Six) ? 0x80 : 0x00);
|
||||
{
|
||||
uInt8 button = (myConsole.controller(Controller::Left).read(Controller::Six) ? 0x80 : 0x00);
|
||||
myINPT4 = (myVBLANK & 0x40) ? (myINPT4 & button) : button;
|
||||
|
||||
value = (value & 0x7F) | myINPT4;
|
||||
break;
|
||||
}
|
||||
|
||||
case INPT5:
|
||||
value = (value & 0x7F) |
|
||||
(myConsole.controller(Controller::Right).read(Controller::Six) ? 0x80 : 0x00);
|
||||
{
|
||||
uInt8 button = (myConsole.controller(Controller::Right).read(Controller::Six) ? 0x80 : 0x00);
|
||||
myINPT5 = (myVBLANK & 0x40) ? (myINPT5 & button) : button;
|
||||
|
||||
value = (value & 0x7F) | myINPT5;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -1321,6 +1330,10 @@ bool TIA::poke(uInt16 addr, uInt8 value)
|
|||
myDumpDisabledCycle = mySystem->cycles();
|
||||
}
|
||||
|
||||
// Are the latches for I4 and I5 being set?
|
||||
if (!(myVBLANK & 0x40))
|
||||
myINPT4 = myINPT5 = 0x80;
|
||||
|
||||
#if 0 // TODO - this isn't yet complete
|
||||
// Check for the first scanline at which VBLANK is disabled.
|
||||
// Usually, this will be the first scanline to start drawing.
|
||||
|
|
|
@ -558,6 +558,9 @@ class TIA : public Device
|
|||
// Indicates if the dump is current enabled for the paddles
|
||||
bool myDumpEnabled;
|
||||
|
||||
// Latches for INPT4 and INPT5
|
||||
uInt8 myINPT4, myINPT5;
|
||||
|
||||
// Indicates if HMOVE blanks are currently or previously enabled,
|
||||
// and at which horizontal position the HMOVE was initiated
|
||||
Int32 myCurrentHMOVEPos;
|
||||
|
|
Loading…
Reference in New Issue