Cleaned up some more FIXMEs.

Added infrastructure to DebuggerParser whereby changes made at the
prompt are automatically propagated to other widgets on the
DebuggerDialog.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@778 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-09-15 19:43:36 +00:00
parent 4996193441
commit aedc59c834
20 changed files with 290 additions and 196 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: FrameBufferGL.cxx,v 1.42 2005-09-13 18:27:42 stephena Exp $
// $Id: FrameBufferGL.cxx,v 1.43 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#ifdef DISPLAY_OPENGL
@ -427,7 +427,10 @@ void FrameBufferGL::translateCoords(Int32* x, Int32* y)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h)
{
// FIXME
// TODO
// Add logic to create one large dirty-rect that encompasses all
// smaller dirty rects. Then in postFrameUpdate(), change the
// coordinates to only update that portion of the texture.
myDirtyFlag = true;
}

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: FrameBufferGL.hxx,v 1.23 2005-08-10 12:23:42 stephena Exp $
// $Id: FrameBufferGL.hxx,v 1.24 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#ifndef FRAMEBUFFER_GL_HXX
@ -37,7 +37,7 @@ class GUI::Font;
This class implements an SDL OpenGL framebuffer.
@author Stephen Anthony
@version $Id: FrameBufferGL.hxx,v 1.23 2005-08-10 12:23:42 stephena Exp $
@version $Id: FrameBufferGL.hxx,v 1.24 2005-09-15 19:43:36 stephena Exp $
*/
class FrameBufferGL : public FrameBuffer
{
@ -241,7 +241,7 @@ class FrameBufferGL : public FrameBuffer
// This is separate from both zoomlevel and aspect ratio
float myFSScaleFactor;
// FIXME - will probably be removed
// TODO - will be removed when textured dirty rect support is added
bool myDirtyFlag;
};

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.91 2005-09-01 19:14:09 stephena Exp $
// $Id: Debugger.cxx,v 1.92 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#include "bspf.hxx"
@ -41,6 +41,8 @@
#include "TiaInfoWidget.hxx"
#include "TiaOutputWidget.hxx"
#include "TiaZoomWidget.hxx"
#include "RomWidget.hxx"
#include "Expression.hxx"
#include "YaccParser.hxx"
@ -94,6 +96,7 @@ Debugger::Debugger(OSystem* osystem)
myTiaInfo(NULL),
myTiaOutput(NULL),
myTiaZoom(NULL),
myRom(NULL),
equateList(NULL),
breakPoints(NULL),
readTraps(NULL),
@ -111,15 +114,6 @@ Debugger::Debugger(OSystem* osystem)
// there will only be ever one instance of debugger in Stella,
// I don't care :)
myStaticDebugger = this;
// init builtins
for(int i=0; builtin_functions[i][0] != ""; i++) {
string f = builtin_functions[i][1];
int res = YaccParser::parse(f.c_str());
if(res != 0) cerr << "ERROR in builtin function!" << endl;
Expression *exp = YaccParser::getResult();
addFunction(builtin_functions[i][0], builtin_functions[i][1], exp, true);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -151,6 +145,7 @@ void Debugger::initialize()
myTiaInfo = dd->tiaInfo();
myTiaOutput = dd->tiaOutput();
myTiaZoom = dd->tiaZoom();
myRom = dd->rom();
// set up any breakpoint that was on the command line
// (and remove the key from the settings, so they won't get set again)
@ -312,6 +307,15 @@ void Debugger::autoExec() {
}
myPrompt->print("autoExec():\n" + myParser->exec(file) + "\n");
myPrompt->printPrompt();
// init builtins
for(int i=0; builtin_functions[i][0] != ""; i++) {
string f = builtin_functions[i][1];
int res = YaccParser::parse(f.c_str());
if(res != 0) cerr << "ERROR in builtin function!" << endl;
Expression *exp = YaccParser::getResult();
addFunction(builtin_functions[i][0], builtin_functions[i][1], exp, true);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -660,8 +664,6 @@ int Debugger::step()
mySystem->m6502().execute(1);
mySystem->lockDataBus();
myBaseDialog->loadConfig();
return mySystem->cycles() - cyc;
}
@ -692,7 +694,6 @@ int Debugger::trace()
mySystem->m6502().execute(1);
mySystem->lockDataBus();
myBaseDialog->loadConfig();
return mySystem->cycles() - cyc;
} else {
@ -815,7 +816,6 @@ void Debugger::nextScanline(int lines) {
mySystem->unlockDataBus();
myTiaOutput->advanceScanline(lines);
mySystem->lockDataBus();
myBaseDialog->loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -824,7 +824,6 @@ void Debugger::nextFrame(int frames) {
mySystem->unlockDataBus();
myTiaOutput->advance(frames);
mySystem->lockDataBus();
myBaseDialog->loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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.hxx,v 1.74 2005-09-01 19:14:09 stephena Exp $
// $Id: Debugger.hxx,v 1.75 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#ifndef DEBUGGER_HXX
@ -28,6 +28,7 @@ class TIADebug;
class TiaInfoWidget;
class TiaOutputWidget;
class TiaZoomWidget;
class RomWidget;
class Expression;
#include <map>
@ -77,7 +78,7 @@ typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)();
for all debugging operations in Stella (parser, 6502 debugger, etc).
@author Stephen Anthony
@version $Id: Debugger.hxx,v 1.74 2005-09-01 19:14:09 stephena Exp $
@version $Id: Debugger.hxx,v 1.75 2005-09-15 19:43:36 stephena Exp $
*/
class Debugger : public DialogContainer
{
@ -192,10 +193,6 @@ class Debugger : public DialogContainer
StringList& bytes, StringList& data,
int start, int lines);
int step();
int trace();
void nextScanline(int lines);
void nextFrame(int frames);
void autoExec();
string showWatches();
@ -305,6 +302,11 @@ class Debugger : public DialogContainer
*/
void resizeDialog();
int step();
int trace();
void nextScanline(int lines);
void nextFrame(int frames);
void toggleBreakPoint(int bp);
bool breakPoint(int bp);
@ -355,6 +357,7 @@ class Debugger : public DialogContainer
TiaInfoWidget* myTiaInfo;
TiaOutputWidget* myTiaOutput;
TiaZoomWidget* myTiaZoom;
RomWidget* myRom;
EquateList *equateList;
PackedBitArray *breakPoints;

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: DebuggerParser.cxx,v 1.77 2005-09-13 18:27:42 stephena Exp $
// $Id: DebuggerParser.cxx,v 1.78 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#include "bspf.hxx"
@ -27,6 +27,7 @@
#include "Expression.hxx"
#include "CheetahCheat.hxx"
#include "Cheat.hxx"
#include "RomWidget.hxx"
#include "DebuggerParser.hxx"
@ -35,6 +36,7 @@ Command DebuggerParser::commands[] = {
"a",
"Set Accumulator to value xx",
true,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeA
},
@ -43,6 +45,7 @@ Command DebuggerParser::commands[] = {
"bank",
"Show # of banks (with no args), Switch to bank (with 1 arg)",
false,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeBank
},
@ -51,6 +54,7 @@ Command DebuggerParser::commands[] = {
"base",
"Set default base (hex, dec, or bin)",
true,
true,
{ kARG_BASE_SPCL, kARG_END_ARGS },
&DebuggerParser::executeBase
},
@ -59,6 +63,7 @@ Command DebuggerParser::commands[] = {
"break",
"Set/clear breakpoint at address (default: current pc)",
false,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeBreak
},
@ -67,6 +72,7 @@ Command DebuggerParser::commands[] = {
"breakif",
"Set breakpoint on condition",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeBreakif
},
@ -75,6 +81,7 @@ Command DebuggerParser::commands[] = {
"c",
"Carry Flag: set (to 0 or 1), or toggle (no arg)",
false,
true,
{ kARG_BOOL, kARG_END_ARGS },
&DebuggerParser::executeC
},
@ -83,6 +90,7 @@ Command DebuggerParser::commands[] = {
"cheetah",
"Use Cheetah cheat code (see http://members.cox.net/rcolbert/)",
false,
false,
// lame: accept 0-4 args instead of inventing a kARG_MULTI_LABEL type
{ kARG_LABEL, kARG_LABEL, kARG_LABEL, kARG_LABEL, kARG_END_ARGS },
&DebuggerParser::executeCheetah
@ -92,6 +100,7 @@ Command DebuggerParser::commands[] = {
"clearbreaks",
"Clear all breakpoints",
false,
true,
{ kARG_END_ARGS },
&DebuggerParser::executeClearbreaks
},
@ -100,6 +109,7 @@ Command DebuggerParser::commands[] = {
"cleartraps",
"Clear all traps",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeCleartraps
},
@ -108,6 +118,7 @@ Command DebuggerParser::commands[] = {
"clearwatches",
"Clear all watches",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeClearwatches
},
@ -116,6 +127,7 @@ Command DebuggerParser::commands[] = {
"colortest",
"Color Test",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeColortest
},
@ -124,6 +136,7 @@ Command DebuggerParser::commands[] = {
"d",
"Decimal Flag: set (to 0 or 1), or toggle (no arg)",
false,
true,
{ kARG_BOOL, kARG_END_ARGS },
&DebuggerParser::executeD
},
@ -132,6 +145,7 @@ Command DebuggerParser::commands[] = {
"define",
"Define label",
true,
true,
{ kARG_LABEL, kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeDefine
},
@ -140,6 +154,7 @@ Command DebuggerParser::commands[] = {
"delbreakif",
"Delete conditional break created with breakif",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeDelbreakif
},
@ -148,6 +163,7 @@ Command DebuggerParser::commands[] = {
"delwatch",
"Delete watch",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeDelwatch
},
@ -156,6 +172,7 @@ Command DebuggerParser::commands[] = {
"disasm",
"Disassemble from address (default=pc)",
false,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeDisasm
},
@ -164,6 +181,7 @@ Command DebuggerParser::commands[] = {
"dump",
"Dump 128 bytes of memory at address",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeDump
},
@ -172,6 +190,7 @@ Command DebuggerParser::commands[] = {
"exec",
"Execute script file",
true,
true,
{ kARG_FILE, kARG_END_ARGS },
&DebuggerParser::executeExec
},
@ -180,6 +199,7 @@ Command DebuggerParser::commands[] = {
"frame",
"Advance emulation by xx frames (default=1)",
false,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeFrame
},
@ -188,6 +208,7 @@ Command DebuggerParser::commands[] = {
"function",
"Define expression as a function for later use",
false,
false,
{ kARG_LABEL, kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeFunction
},
@ -196,6 +217,7 @@ Command DebuggerParser::commands[] = {
"height",
"Change height of debugger window",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeHeight
},
@ -204,6 +226,7 @@ Command DebuggerParser::commands[] = {
"help",
"This cruft",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeHelp
},
@ -212,6 +235,7 @@ Command DebuggerParser::commands[] = {
"list",
"List source (if loaded with loadlst)",
false,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeList
},
@ -220,6 +244,7 @@ Command DebuggerParser::commands[] = {
"listbreaks",
"List breakpoints",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeListbreaks
},
@ -228,6 +253,7 @@ Command DebuggerParser::commands[] = {
"listtraps",
"List traps",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeListtraps
},
@ -236,6 +262,7 @@ Command DebuggerParser::commands[] = {
"listwatches",
"List watches",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeListwatches
},
@ -244,6 +271,7 @@ Command DebuggerParser::commands[] = {
"loadstate",
"Load emulator state (0-9)",
true,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeLoadstate
},
@ -252,6 +280,7 @@ Command DebuggerParser::commands[] = {
"loadlist",
"Load DASM listing file",
true,
true,
{ kARG_FILE, kARG_END_ARGS },
&DebuggerParser::executeLoadlist
},
@ -260,6 +289,7 @@ Command DebuggerParser::commands[] = {
"loadsym",
"Load symbol file",
true,
true,
{ kARG_FILE, kARG_END_ARGS },
&DebuggerParser::executeLoadsym
},
@ -268,6 +298,7 @@ Command DebuggerParser::commands[] = {
"n",
"Negative Flag: set (to 0 or 1), or toggle (no arg)",
false,
true,
{ kARG_BOOL, kARG_END_ARGS },
&DebuggerParser::executeN
},
@ -276,6 +307,7 @@ Command DebuggerParser::commands[] = {
"pc",
"Set Program Counter to address",
true,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executePc
},
@ -284,6 +316,7 @@ Command DebuggerParser::commands[] = {
"poke",
"Set address to value. Can give multiple values (for address+1, etc)",
true,
true,
{ kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeRam
},
@ -292,6 +325,7 @@ Command DebuggerParser::commands[] = {
"print",
"Evaluate and print expression in hex/dec/binary",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executePrint
},
@ -300,6 +334,7 @@ Command DebuggerParser::commands[] = {
"ram",
"Show RAM contents (no args), or set address xx to value yy",
false,
true,
{ kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeRam
},
@ -308,6 +343,7 @@ Command DebuggerParser::commands[] = {
"reload",
"Reload ROM and symbol file",
false,
true,
{ kARG_END_ARGS },
&DebuggerParser::executeReload
},
@ -316,6 +352,7 @@ Command DebuggerParser::commands[] = {
"reset",
"Reset 6507 to init vector (does not reset TIA, RIOT)",
false,
true,
{ kARG_END_ARGS },
&DebuggerParser::executeReset
},
@ -324,6 +361,7 @@ Command DebuggerParser::commands[] = {
"riot",
"Show RIOT timer/input status",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeRiot
},
@ -332,6 +370,7 @@ Command DebuggerParser::commands[] = {
"rom",
"Change ROM contents",
true,
true,
{ kARG_WORD, kARG_MULTI_BYTE },
&DebuggerParser::executeRom
},
@ -340,6 +379,7 @@ Command DebuggerParser::commands[] = {
"run",
"Exit debugger, return to emulator",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeRun
},
@ -348,6 +388,7 @@ Command DebuggerParser::commands[] = {
"runto",
"Run until first occurrence of string in disassembly",
false,
true,
{ kARG_LABEL, kARG_END_ARGS },
&DebuggerParser::executeRunTo
},
@ -356,6 +397,7 @@ Command DebuggerParser::commands[] = {
"s",
"Set Stack Pointer to value xx",
true,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeS
},
@ -364,6 +406,7 @@ Command DebuggerParser::commands[] = {
"save",
"Save breaks, watches, traps as a .stella script file",
true,
false,
{ kARG_FILE, kARG_END_ARGS },
&DebuggerParser::executeSave
},
@ -372,6 +415,7 @@ Command DebuggerParser::commands[] = {
"saverom",
"Save (possibly patched) ROM to file",
true,
false,
{ kARG_FILE, kARG_END_ARGS },
&DebuggerParser::executeSaverom
},
@ -380,6 +424,7 @@ Command DebuggerParser::commands[] = {
"saveses",
"Save console session to file",
true,
false,
{ kARG_FILE, kARG_END_ARGS },
&DebuggerParser::executeSaveses
},
@ -388,6 +433,7 @@ Command DebuggerParser::commands[] = {
"savestate",
"Save emulator state (valid args 0-9)",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeSavestate
},
@ -396,6 +442,7 @@ Command DebuggerParser::commands[] = {
"savesym",
"Save symbols to file",
true,
false,
{ kARG_FILE, kARG_END_ARGS },
&DebuggerParser::executeSavesym
},
@ -404,6 +451,7 @@ Command DebuggerParser::commands[] = {
"scanline",
"Advance emulation by xx scanlines (default=1)",
false,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeScanline
},
@ -412,6 +460,7 @@ Command DebuggerParser::commands[] = {
"step",
"Single step CPU (optionally, with count)",
false,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeStep
},
@ -420,6 +469,7 @@ Command DebuggerParser::commands[] = {
"tia",
"Show TIA state (NOT FINISHED YET)",
false,
false,
{ kARG_END_ARGS },
&DebuggerParser::executeTia
},
@ -428,6 +478,7 @@ Command DebuggerParser::commands[] = {
"trace",
"Single step CPU (optionally, with count), subroutines count as one instruction",
false,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeTrace
},
@ -436,6 +487,7 @@ Command DebuggerParser::commands[] = {
"trap",
"Trap read and write accesses to address",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeTrap
},
@ -444,6 +496,7 @@ Command DebuggerParser::commands[] = {
"trapread",
"Trap read accesses to address",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeTrapread
},
@ -452,6 +505,7 @@ Command DebuggerParser::commands[] = {
"trapwrite",
"Trap write accesses to address",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeTrapwrite
},
@ -460,6 +514,7 @@ Command DebuggerParser::commands[] = {
"undef",
"Undefine label (if defined)",
true,
true,
{ kARG_LABEL, kARG_END_ARGS },
&DebuggerParser::executeUndef
},
@ -468,6 +523,7 @@ Command DebuggerParser::commands[] = {
"v",
"Overflow Flag: set (to 0 or 1), or toggle (no arg)",
false,
true,
{ kARG_BOOL, kARG_END_ARGS },
&DebuggerParser::executeV
},
@ -476,6 +532,7 @@ Command DebuggerParser::commands[] = {
"watch",
"Print contents of address before every prompt",
true,
false,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeWatch
},
@ -484,6 +541,7 @@ Command DebuggerParser::commands[] = {
"x",
"Set X Register to value xx",
true,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeX
},
@ -492,6 +550,7 @@ Command DebuggerParser::commands[] = {
"y",
"Set Y Register to value xx",
true,
true,
{ kARG_WORD, kARG_END_ARGS },
&DebuggerParser::executeY
},
@ -500,6 +559,7 @@ Command DebuggerParser::commands[] = {
"z",
"Zero Flag: set (to 0 or 1), or toggle (no arg)",
false,
true,
{ kARG_BOOL, kARG_END_ARGS },
&DebuggerParser::executeZ
},
@ -508,6 +568,7 @@ Command DebuggerParser::commands[] = {
"",
"",
false,
false,
{ kARG_END_ARGS },
NULL
}
@ -1070,6 +1131,9 @@ string DebuggerParser::run(const string& command) {
if( validateArgs(i) )
CALL_METHOD(commands[i].executor);
if( commands[i].refreshRequired )
debugger->myBaseDialog->loadConfig();
return commandResult;
}
@ -1527,6 +1591,13 @@ void DebuggerParser::executeRom() {
}
}
// Normally the run() method calls loadConfig() on the debugger,
// which results in all child widgets being redrawn.
// The RomWidget is a special case, since we don't want to re-disassemble
// any more than necessary. So we only do it by calling the following
// method ...
debugger->myRom->invalidate();
commandResult = "changed ";
commandResult += debugger->valueToString( args.size() - 1 );
commandResult += " location(s)";

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: DebuggerParser.hxx,v 1.41 2005-08-16 18:34:12 stephena Exp $
// $Id: DebuggerParser.hxx,v 1.42 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#ifndef DEBUGGER_PARSER_HXX
@ -35,124 +35,129 @@ typedef enum {
class DebuggerParser
{
public:
DebuggerParser(Debugger* debugger);
~DebuggerParser();
public:
DebuggerParser(Debugger* debugger);
~DebuggerParser();
string run(const string& command);
int decipher_arg(const string &str);
string run(const string& command);
int decipher_arg(const string &str);
void setBase(BaseFormat base) { defaultBase = base; }
BaseFormat base() { return defaultBase; }
string showWatches();
string addWatch(string watch);
string delWatch(int which);
void delAllWatches();
int countCompletions(const char *in);
const char *getCompletions();
const char *getCompletionPrefix();
string exec(const string& cmd, bool verbose=true);
void setBase(BaseFormat base) { defaultBase = base; }
BaseFormat base() { return defaultBase; }
static inline string red(string msg ="") {
// This is TIA color 0x34. The octal value is 0x80+(0x34>>1).
return "\232" + msg;
}
string showWatches();
string addWatch(string watch);
string delWatch(int which);
void delAllWatches();
static inline string inverse(string msg ="") {
// ASCII DEL char, decimal 127
return "\177" + msg;
}
int countCompletions(const char *in);
const char *getCompletions();
const char *getCompletionPrefix();
string exec(const string& cmd, bool verbose=true);
private:
bool getArgs(const string& command);
bool validateArgs(int cmd);
int conv_hex_digit(char d);
bool subStringMatch(const string& needle, const string& haystack);
string disasm();
string listBreaks();
string listTraps();
string eval();
string dump();
string trapStatus(int addr);
static inline string red(string msg ="")
{
// This is TIA color 0x34. The octal value is 0x80+(0x34>>1).
return "\232" + msg;
}
Debugger* debugger;
static inline string inverse(string msg ="")
{
// ASCII DEL char, decimal 127
return "\177" + msg;
}
bool done;
private:
bool getArgs(const string& command);
bool validateArgs(int cmd);
int conv_hex_digit(char d);
bool subStringMatch(const string& needle, const string& haystack);
string disasm();
string listBreaks();
string listTraps();
string eval();
string dump();
string trapStatus(int addr);
string verb;
string commandResult;
private:
Debugger* debugger;
IntArray args;
StringList argStrings;
int argCount;
bool done;
BaseFormat defaultBase;
StringList watches;
static Command commands[];
string verb;
string commandResult;
string completions;
string compPrefix;
IntArray args;
StringList argStrings;
int argCount;
bool saveScriptFile(string file);
BaseFormat defaultBase;
StringList watches;
static Command commands[];
void executeA();
void executeBank();
void executeBase();
void executeBreak();
void executeBreakif();
void executeC();
void executeCheetah();
void executeClearbreaks();
void executeCleartraps();
void executeClearwatches();
void executeColortest();
void executeD();
void executeDefine();
void executeDelbreakif();
void executeDelwatch();
void executeDisasm();
void executeDump();
void executeExec();
void executeFrame();
void executeFunction();
void executeHeight();
void executeHelp();
void executeList();
void executeListbreaks();
void executeListtraps();
void executeListwatches();
void executeLoadlist();
void executeLoadsym();
void executeLoadstate();
void executeN();
void executePc();
void executePrint();
void executeRam();
void executeReload();
void executeReset();
void executeRiot();
void executeRom();
void executeRun();
void executeRunTo();
void executeS();
void executeSave();
void executeSaverom();
void executeSaveses();
void executeSavestate();
void executeSavesym();
void executeScanline();
void executeStep();
void executeTia();
void executeTrace();
void executeTrap();
void executeTrapread();
void executeTrapwrite();
void executeUndef();
void executeV();
void executeWatch();
void executeX();
void executeY();
void executeZ();
string completions;
string compPrefix;
bool saveScriptFile(string file);
void executeA();
void executeBank();
void executeBase();
void executeBreak();
void executeBreakif();
void executeC();
void executeCheetah();
void executeClearbreaks();
void executeCleartraps();
void executeClearwatches();
void executeColortest();
void executeD();
void executeDefine();
void executeDelbreakif();
void executeDelwatch();
void executeDisasm();
void executeDump();
void executeExec();
void executeFrame();
void executeFunction();
void executeHeight();
void executeHelp();
void executeList();
void executeListbreaks();
void executeListtraps();
void executeListwatches();
void executeLoadlist();
void executeLoadsym();
void executeLoadstate();
void executeN();
void executePc();
void executePrint();
void executeRam();
void executeReload();
void executeReset();
void executeRiot();
void executeRom();
void executeRun();
void executeRunTo();
void executeS();
void executeSave();
void executeSaverom();
void executeSaveses();
void executeSavestate();
void executeSavesym();
void executeScanline();
void executeStep();
void executeTia();
void executeTrace();
void executeTrap();
void executeTrapread();
void executeTrapwrite();
void executeUndef();
void executeV();
void executeWatch();
void executeX();
void executeY();
void executeZ();
};
// TODO: put in separate header file Command.hxx
@ -167,24 +172,24 @@ typedef void (DebuggerParser::*METHOD)();
#define CALL_METHOD(method) ( (this->*method)() )
typedef enum {
kARG_WORD, // single 16-bit value
kARG_MULTI_WORD, // multiple 16-bit values (must occur last)
kARG_BYTE, // single 8-bit value
kARG_MULTI_BYTE, // multiple 8-bit values (must occur last)
kARG_BOOL, // 0 or 1 only
kARG_LABEL, // label (need not be defined, treated as string)
kARG_FILE, // filename
kARG_BASE_SPCL, // base specifier: 2, 10, or 16 (or "bin" "dec" "hex")
kARG_END_ARGS // sentinel, occurs at end of list
kARG_WORD, // single 16-bit value
kARG_MULTI_WORD, // multiple 16-bit values (must occur last)
kARG_BYTE, // single 8-bit value
kARG_MULTI_BYTE, // multiple 8-bit values (must occur last)
kARG_BOOL, // 0 or 1 only
kARG_LABEL, // label (need not be defined, treated as string)
kARG_FILE, // filename
kARG_BASE_SPCL, // base specifier: 2, 10, or 16 (or "bin" "dec" "hex")
kARG_END_ARGS // sentinel, occurs at end of list
} parameters;
struct Command {
string cmdString;
string description;
bool parmsRequired;
parameters parms[kMAX_ARG_TYPES];
METHOD executor;
string cmdString;
string description;
bool parmsRequired;
bool refreshRequired;
parameters parms[kMAX_ARG_TYPES];
METHOD executor;
};
#endif

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: DivExpression.hxx,v 1.3 2005-07-27 01:36:50 urchlay Exp $
// $Id: DivExpression.hxx,v 1.4 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#ifndef DIV_EXPRESSION_HXX
@ -24,15 +24,15 @@
/**
@author B. Watson
@version $Id: DivExpression.hxx,v 1.3 2005-07-27 01:36:50 urchlay Exp $
@version $Id: DivExpression.hxx,v 1.4 2005-09-15 19:43:36 stephena Exp $
*/
class DivExpression : public Expression
{
public:
DivExpression(Expression *left, Expression *right);
uInt16 evaluate() { int denom = myRHS->evaluate();
return denom == 0 ? 0 : myLHS->evaluate() / denom;
}
return denom == 0 ? 0 : myLHS->evaluate() / denom;
}
};
#endif

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: ModExpression.hxx,v 1.2 2005-07-27 01:36:51 urchlay Exp $
// $Id: ModExpression.hxx,v 1.3 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#ifndef MOD_EXPRESSION_HXX
@ -24,14 +24,15 @@
/**
@author B. Watson
@version $Id: ModExpression.hxx,v 1.2 2005-07-27 01:36:51 urchlay Exp $
@version $Id: ModExpression.hxx,v 1.3 2005-09-15 19:43:36 stephena Exp $
*/
class ModExpression : public Expression
{
public:
ModExpression(Expression *left, Expression *right);
uInt16 evaluate() { return myLHS->evaluate() % myRHS->evaluate(); } // FIXME: div by zero?
uInt16 evaluate() { int rhs = myRHS->evaluate();
return rhs == 0 ? 0 : myLHS->evaluate() % rhs;
}
};
#endif

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: DebuggerDialog.cxx,v 1.4 2005-09-06 22:25:40 stephena Exp $
// $Id: DebuggerDialog.cxx,v 1.5 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -33,6 +33,7 @@
#include "DataGridOpsWidget.hxx"
#include "Rect.hxx"
#include "Debugger.hxx"
#include "DebuggerParser.hxx"
#include "DebuggerDialog.hxx"
@ -225,25 +226,25 @@ void DebuggerDialog::addRomArea()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doStep()
{
instance()->debugger().step();
instance()->debugger().parser()->run("step");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doTrace()
{
instance()->debugger().trace();
instance()->debugger().parser()->run("trace");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doAdvance()
{
instance()->debugger().nextFrame(1);
instance()->debugger().parser()->run("frame #1");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doScanlineAdvance()
{
instance()->debugger().nextScanline(1);
instance()->debugger().parser()->run("scanline #1");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: DebuggerDialog.hxx,v 1.2 2005-08-31 19:15:10 stephena Exp $
// $Id: DebuggerDialog.hxx,v 1.3 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -47,6 +47,7 @@ class DebuggerDialog : public Dialog
TiaInfoWidget* tiaInfo() { return myTiaInfo; }
TiaOutputWidget* tiaOutput() { return myTiaOutput; }
TiaZoomWidget* tiaZoom() { return myTiaZoom; }
RomWidget* rom() { return myRom; }
virtual void loadConfig();
virtual void handleKeyDown(int ascii, int keycode, int modifiers);

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.4 2005-09-13 18:27:42 stephena Exp $
// $Id: RomWidget.cxx,v 1.5 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -33,7 +33,7 @@
RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
: Widget(boss, x, y, 16, 16),
CommandSender(boss),
myFirstLoad(true),
myListIsDirty(true),
mySourceAvailable(false),
myCurrentBank(-1)
{
@ -92,15 +92,13 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::loadConfig()
{
cerr << " ==> RomWidget::loadConfig()\n";
Debugger& dbg = instance()->debugger();
// Only reload full bank when necessary
if(myFirstLoad || myCurrentBank != instance()->debugger().getBank())
if(myListIsDirty || myCurrentBank != dbg.getBank())
{
initialUpdate();
myFirstLoad = false;
myListIsDirty = false;
}
else // only reload what's in current view
{
@ -123,7 +121,7 @@ void RomWidget::initialUpdate()
// Fill romlist the current bank of source or disassembly
if(mySourceAvailable)
; // FIXME
; // TODO - actually implement this
else
{
// Clear old mappings
@ -150,6 +148,7 @@ void RomWidget::initialUpdate()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::incrementalUpdate(int line, int rows)
{
// TODO - implement this
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -157,9 +156,9 @@ void RomWidget::setBreak(int data)
{
// We don't care about state, as breakpoints are turned on
// and off with the same command
// FIXME - at some point, we might want to add 'breakon'
// and 'breakoff' to DebuggerParser, so the states
// don't get out of sync
// TODO - at some point, we might want to add 'breakon'
// and 'breakoff' to DebuggerParser, so the states
// don't get out of sync
ostringstream command;
command << "break #" << myAddrList[data];
instance()->debugger().run(command.str());

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.hxx,v 1.3 2005-09-13 18:27:42 stephena Exp $
// $Id: RomWidget.hxx,v 1.4 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -41,8 +41,9 @@ class RomWidget : public Widget, public CommandSender
RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y);
virtual ~RomWidget();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
void invalidate() { myListIsDirty = true; }
void handleCommand(CommandSender* sender, int cmd, int data, int id);
void loadConfig();
private:
@ -67,7 +68,7 @@ class RomWidget : public Widget, public CommandSender
Invalid lines need to be disassembled again */
BoolArray myLineValid;
bool myFirstLoad;
bool myListIsDirty;
bool mySourceAvailable;
int myCurrentBank;
};

View File

@ -13,12 +13,14 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: TiaOutputWidget.cxx,v 1.4 2005-09-06 22:25:40 stephena Exp $
// $Id: TiaOutputWidget.cxx,v 1.5 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
//============================================================================
#include <sstream>
#include "OSystem.hxx"
#include "FrameBuffer.hxx"
#include "Widget.hxx"
@ -26,6 +28,7 @@
#include "ContextMenu.hxx"
#include "TiaZoomWidget.hxx"
#include "Debugger.hxx"
#include "DebuggerParser.hxx"
#include "TIADebug.hxx"
#include "TiaOutputWidget.hxx"
@ -105,10 +108,14 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in
{
case 0:
{
ostringstream command;
int ystart = atoi(instance()->console().properties().get("Display.YStart").c_str());
int lines = myClickY + ystart - instance()->debugger().tiaDebug().scanlines();
if(lines > 0)
instance()->debugger().nextScanline(lines);
{
command << "scanline #" << lines;
instance()->debugger().parser()->run(command.str());
}
break;
}

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: EventHandler.cxx,v 1.95 2005-09-11 22:55:51 stephena Exp $
// $Id: EventHandler.cxx,v 1.96 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#include <algorithm>
@ -858,7 +858,7 @@ void EventHandler::handleMouseButtonEvent(SDL_Event& event, uInt8 state)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::handleJoyMouse(uInt32 time)
{
bool mouseAccel = false; // FIXME - make this a commandline option
bool mouseAccel = false; // TODO - make this a commandline option
if (time >= myJoyMouse.last_time + myJoyMouse.delay_time)
{
@ -1004,8 +1004,8 @@ void EventHandler::handleJoyEvent(uInt8 stick, uInt32 code, uInt8 state)
}
// Determine which mode we're in, then send the event to the appropriate place
// FIXME - this is almost exactly the same as handleKeyEvent
// the similar code should be handled in handleEvent ...
// TODO - this is almost exactly the same as handleKeyEvent
// the similar code should be handled in handleEvent ...
Event::Type event = myJoyTable[stick*kNumJoyButtons + code];
switch(myState)
{

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: FrameBuffer.hxx,v 1.56 2005-08-30 01:10:54 stephena Exp $
// $Id: FrameBuffer.hxx,v 1.57 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#ifndef FRAMEBUFFER_HXX
@ -52,7 +52,7 @@ enum FrameStyle {
All GUI elements (ala ScummVM) are drawn here as well.
@author Stephen Anthony
@version $Id: FrameBuffer.hxx,v 1.56 2005-08-30 01:10:54 stephena Exp $
@version $Id: FrameBuffer.hxx,v 1.57 2005-09-15 19:43:36 stephena Exp $
*/
class FrameBuffer
{
@ -221,8 +221,8 @@ class FrameBuffer
@param y The y coordinate
@param w The width of the box
@param h The height of the box
@param colorA FIXME
@param colorB FIXME
@param colorA Lighter color for outside line.
@param colorB Darker color for inside line.
*/
void box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor colorA, OverlayColor colorB);

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: TIA.cxx,v 1.57 2005-09-06 19:42:35 stephena Exp $
// $Id: TIA.cxx,v 1.58 2005-09-15 19:43:36 stephena Exp $
//============================================================================
#include <cassert>
@ -3261,7 +3261,7 @@ const uInt32 TIA::ourPALPalette11[256] = {
0x000000, 0x000000, 0x242424, 0x242424,
0x484848, 0x484848, 0x6d6d6d, 0x6d6d6d,
0x919191, 0x919191, 0xb6b6b6, 0xb6b6b6,
0xdadada, 0xdadada, 0xffffff, 0xff4ffff // FIXME - check this out
0xdadada, 0xdadada, 0xffffff, 0xff4ffff
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: BrowserDialog.cxx,v 1.10 2005-08-22 18:17:10 stephena Exp $
// $Id: BrowserDialog.cxx,v 1.11 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -39,6 +39,7 @@ enum {
* - to select the data dir for a game
* - to select the place where save games are stored
* - others???
* TODO - make this dialog font sensitive
*/
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -54,7 +55,7 @@ BrowserDialog::BrowserDialog(GuiObject* boss, int x, int y, int w, int h)
_currentPath = new StaticTextWidget(this, 10, 20, _w - 2 * 10, kLineHeight,
"DUMMY", kTextAlignLeft);
// Add file list FIXME_NOW
// Add file list
_fileList = new StringListWidget(this, instance()->font(),
10, 34, _w - 2 * 10, _h - 34 - 24 - 10);
_fileList->setNumberingMode(kListNumberingOff);

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: LauncherDialog.cxx,v 1.30 2005-08-30 01:10:54 stephena Exp $
// $Id: LauncherDialog.cxx,v 1.31 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -40,6 +40,10 @@
#include "bspf.hxx"
/////////////////////////////////////////
// TODO - make this dialog font sensitive
/////////////////////////////////////////
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
int x, int y, int w, int h)
@ -91,7 +95,7 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
// Add list with game titles
myList = new StringListWidget(this, instance()->font(),
10, 24, _w - 20, _h - 24 - 26 - 10 - 10); // FIXME_NOW
10, 24, _w - 20, _h - 24 - 26 - 10 - 10);
myList->setNumberingMode(kListNumberingOff);
myList->setEditable(false);
myList->setFlags(WIDGET_NODRAW_FOCUS);

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: LauncherOptionsDialog.cxx,v 1.12 2005-09-06 22:25:40 stephena Exp $
// $Id: LauncherOptionsDialog.cxx,v 1.13 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -97,8 +97,6 @@ LauncherOptionsDialog::LauncherOptionsDialog(
int baseW = instance()->frameBuffer().baseWidth();
int baseH = instance()->frameBuffer().baseHeight();
myBrowser = new BrowserDialog(this, 60, 20, baseW - 120, baseH - 40);
loadConfig(); // FIXME
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: PopUpWidget.cxx,v 1.17 2005-09-11 22:55:51 stephena Exp $
// $Id: PopUpWidget.cxx,v 1.18 2005-09-15 19:43:36 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -215,7 +215,7 @@ void PopUpDialog::sendSelection()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PopUpDialog::isMouseDown()
{
// TODO/FIXME - need a way to determine whether any mouse buttons are pressed or not.
// TODO - need a way to determine whether any mouse buttons are pressed or not.
// Sure, we could just count mouse button up/down events, but that is cumbersome and
// error prone. Would be much nicer to add an API to OSystem for this...