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 // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #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) 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; myDirtyFlag = true;
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef FRAMEBUFFER_GL_HXX
@ -37,7 +37,7 @@ class GUI::Font;
This class implements an SDL OpenGL framebuffer. This class implements an SDL OpenGL framebuffer.
@author Stephen Anthony @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 class FrameBufferGL : public FrameBuffer
{ {
@ -241,7 +241,7 @@ class FrameBufferGL : public FrameBuffer
// This is separate from both zoomlevel and aspect ratio // This is separate from both zoomlevel and aspect ratio
float myFSScaleFactor; float myFSScaleFactor;
// FIXME - will probably be removed // TODO - will be removed when textured dirty rect support is added
bool myDirtyFlag; bool myDirtyFlag;
}; };

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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" #include "bspf.hxx"
@ -41,6 +41,8 @@
#include "TiaInfoWidget.hxx" #include "TiaInfoWidget.hxx"
#include "TiaOutputWidget.hxx" #include "TiaOutputWidget.hxx"
#include "TiaZoomWidget.hxx" #include "TiaZoomWidget.hxx"
#include "RomWidget.hxx"
#include "Expression.hxx" #include "Expression.hxx"
#include "YaccParser.hxx" #include "YaccParser.hxx"
@ -94,6 +96,7 @@ Debugger::Debugger(OSystem* osystem)
myTiaInfo(NULL), myTiaInfo(NULL),
myTiaOutput(NULL), myTiaOutput(NULL),
myTiaZoom(NULL), myTiaZoom(NULL),
myRom(NULL),
equateList(NULL), equateList(NULL),
breakPoints(NULL), breakPoints(NULL),
readTraps(NULL), readTraps(NULL),
@ -111,15 +114,6 @@ Debugger::Debugger(OSystem* osystem)
// there will only be ever one instance of debugger in Stella, // there will only be ever one instance of debugger in Stella,
// I don't care :) // I don't care :)
myStaticDebugger = this; 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(); myTiaInfo = dd->tiaInfo();
myTiaOutput = dd->tiaOutput(); myTiaOutput = dd->tiaOutput();
myTiaZoom = dd->tiaZoom(); myTiaZoom = dd->tiaZoom();
myRom = dd->rom();
// set up any breakpoint that was on the command line // set up any breakpoint that was on the command line
// (and remove the key from the settings, so they won't get set again) // (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->print("autoExec():\n" + myParser->exec(file) + "\n");
myPrompt->printPrompt(); 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->m6502().execute(1);
mySystem->lockDataBus(); mySystem->lockDataBus();
myBaseDialog->loadConfig();
return mySystem->cycles() - cyc; return mySystem->cycles() - cyc;
} }
@ -692,7 +694,6 @@ int Debugger::trace()
mySystem->m6502().execute(1); mySystem->m6502().execute(1);
mySystem->lockDataBus(); mySystem->lockDataBus();
myBaseDialog->loadConfig();
return mySystem->cycles() - cyc; return mySystem->cycles() - cyc;
} else { } else {
@ -815,7 +816,6 @@ void Debugger::nextScanline(int lines) {
mySystem->unlockDataBus(); mySystem->unlockDataBus();
myTiaOutput->advanceScanline(lines); myTiaOutput->advanceScanline(lines);
mySystem->lockDataBus(); mySystem->lockDataBus();
myBaseDialog->loadConfig();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -824,7 +824,6 @@ void Debugger::nextFrame(int frames) {
mySystem->unlockDataBus(); mySystem->unlockDataBus();
myTiaOutput->advance(frames); myTiaOutput->advance(frames);
mySystem->lockDataBus(); mySystem->lockDataBus();
myBaseDialog->loadConfig();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef DEBUGGER_HXX
@ -28,6 +28,7 @@ class TIADebug;
class TiaInfoWidget; class TiaInfoWidget;
class TiaOutputWidget; class TiaOutputWidget;
class TiaZoomWidget; class TiaZoomWidget;
class RomWidget;
class Expression; class Expression;
#include <map> #include <map>
@ -77,7 +78,7 @@ typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)();
for all debugging operations in Stella (parser, 6502 debugger, etc). for all debugging operations in Stella (parser, 6502 debugger, etc).
@author Stephen Anthony @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 class Debugger : public DialogContainer
{ {
@ -192,10 +193,6 @@ class Debugger : public DialogContainer
StringList& bytes, StringList& data, StringList& bytes, StringList& data,
int start, int lines); int start, int lines);
int step();
int trace();
void nextScanline(int lines);
void nextFrame(int frames);
void autoExec(); void autoExec();
string showWatches(); string showWatches();
@ -305,6 +302,11 @@ class Debugger : public DialogContainer
*/ */
void resizeDialog(); void resizeDialog();
int step();
int trace();
void nextScanline(int lines);
void nextFrame(int frames);
void toggleBreakPoint(int bp); void toggleBreakPoint(int bp);
bool breakPoint(int bp); bool breakPoint(int bp);
@ -355,6 +357,7 @@ class Debugger : public DialogContainer
TiaInfoWidget* myTiaInfo; TiaInfoWidget* myTiaInfo;
TiaOutputWidget* myTiaOutput; TiaOutputWidget* myTiaOutput;
TiaZoomWidget* myTiaZoom; TiaZoomWidget* myTiaZoom;
RomWidget* myRom;
EquateList *equateList; EquateList *equateList;
PackedBitArray *breakPoints; PackedBitArray *breakPoints;

View File

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

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef DEBUGGER_PARSER_HXX
@ -44,21 +44,25 @@ class DebuggerParser
void setBase(BaseFormat base) { defaultBase = base; } void setBase(BaseFormat base) { defaultBase = base; }
BaseFormat base() { return defaultBase; } BaseFormat base() { return defaultBase; }
string showWatches(); string showWatches();
string addWatch(string watch); string addWatch(string watch);
string delWatch(int which); string delWatch(int which);
void delAllWatches(); void delAllWatches();
int countCompletions(const char *in); int countCompletions(const char *in);
const char *getCompletions(); const char *getCompletions();
const char *getCompletionPrefix(); const char *getCompletionPrefix();
string exec(const string& cmd, bool verbose=true); string exec(const string& cmd, bool verbose=true);
static inline string red(string msg ="") { static inline string red(string msg ="")
{
// This is TIA color 0x34. The octal value is 0x80+(0x34>>1). // This is TIA color 0x34. The octal value is 0x80+(0x34>>1).
return "\232" + msg; return "\232" + msg;
} }
static inline string inverse(string msg ="") { static inline string inverse(string msg ="")
{
// ASCII DEL char, decimal 127 // ASCII DEL char, decimal 127
return "\177" + msg; return "\177" + msg;
} }
@ -75,6 +79,7 @@ class DebuggerParser
string dump(); string dump();
string trapStatus(int addr); string trapStatus(int addr);
private:
Debugger* debugger; Debugger* debugger;
bool done; bool done;
@ -182,9 +187,9 @@ struct Command {
string cmdString; string cmdString;
string description; string description;
bool parmsRequired; bool parmsRequired;
bool refreshRequired;
parameters parms[kMAX_ARG_TYPES]; parameters parms[kMAX_ARG_TYPES];
METHOD executor; METHOD executor;
}; };
#endif #endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef DIV_EXPRESSION_HXX
@ -24,7 +24,7 @@
/** /**
@author B. Watson @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 class DivExpression : public Expression
{ {

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef MOD_EXPRESSION_HXX
@ -24,14 +24,15 @@
/** /**
@author B. Watson @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 class ModExpression : public Expression
{ {
public: public:
ModExpression(Expression *left, Expression *right); 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 #endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -33,6 +33,7 @@
#include "DataGridOpsWidget.hxx" #include "DataGridOpsWidget.hxx"
#include "Rect.hxx" #include "Rect.hxx"
#include "Debugger.hxx" #include "Debugger.hxx"
#include "DebuggerParser.hxx"
#include "DebuggerDialog.hxx" #include "DebuggerDialog.hxx"
@ -225,25 +226,25 @@ void DebuggerDialog::addRomArea()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doStep() void DebuggerDialog::doStep()
{ {
instance()->debugger().step(); instance()->debugger().parser()->run("step");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doTrace() void DebuggerDialog::doTrace()
{ {
instance()->debugger().trace(); instance()->debugger().parser()->run("trace");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doAdvance() void DebuggerDialog::doAdvance()
{ {
instance()->debugger().nextFrame(1); instance()->debugger().parser()->run("frame #1");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doScanlineAdvance() 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 // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -47,6 +47,7 @@ class DebuggerDialog : public Dialog
TiaInfoWidget* tiaInfo() { return myTiaInfo; } TiaInfoWidget* tiaInfo() { return myTiaInfo; }
TiaOutputWidget* tiaOutput() { return myTiaOutput; } TiaOutputWidget* tiaOutput() { return myTiaOutput; }
TiaZoomWidget* tiaZoom() { return myTiaZoom; } TiaZoomWidget* tiaZoom() { return myTiaZoom; }
RomWidget* rom() { return myRom; }
virtual void loadConfig(); virtual void loadConfig();
virtual void handleKeyDown(int ascii, int keycode, int modifiers); 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 // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -33,7 +33,7 @@
RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y) RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
: Widget(boss, x, y, 16, 16), : Widget(boss, x, y, 16, 16),
CommandSender(boss), CommandSender(boss),
myFirstLoad(true), myListIsDirty(true),
mySourceAvailable(false), mySourceAvailable(false),
myCurrentBank(-1) myCurrentBank(-1)
{ {
@ -92,15 +92,13 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::loadConfig() void RomWidget::loadConfig()
{ {
cerr << " ==> RomWidget::loadConfig()\n";
Debugger& dbg = instance()->debugger(); Debugger& dbg = instance()->debugger();
// Only reload full bank when necessary // Only reload full bank when necessary
if(myFirstLoad || myCurrentBank != instance()->debugger().getBank()) if(myListIsDirty || myCurrentBank != dbg.getBank())
{ {
initialUpdate(); initialUpdate();
myFirstLoad = false; myListIsDirty = false;
} }
else // only reload what's in current view else // only reload what's in current view
{ {
@ -123,7 +121,7 @@ void RomWidget::initialUpdate()
// Fill romlist the current bank of source or disassembly // Fill romlist the current bank of source or disassembly
if(mySourceAvailable) if(mySourceAvailable)
; // FIXME ; // TODO - actually implement this
else else
{ {
// Clear old mappings // Clear old mappings
@ -150,6 +148,7 @@ void RomWidget::initialUpdate()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::incrementalUpdate(int line, int rows) void RomWidget::incrementalUpdate(int line, int rows)
{ {
// TODO - implement this
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -157,7 +156,7 @@ void RomWidget::setBreak(int data)
{ {
// We don't care about state, as breakpoints are turned on // We don't care about state, as breakpoints are turned on
// and off with the same command // and off with the same command
// FIXME - at some point, we might want to add 'breakon' // TODO - at some point, we might want to add 'breakon'
// and 'breakoff' to DebuggerParser, so the states // and 'breakoff' to DebuggerParser, so the states
// don't get out of sync // don't get out of sync
ostringstream command; ostringstream command;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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); RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y);
virtual ~RomWidget(); 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(); void loadConfig();
private: private:
@ -67,7 +68,7 @@ class RomWidget : public Widget, public CommandSender
Invalid lines need to be disassembled again */ Invalid lines need to be disassembled again */
BoolArray myLineValid; BoolArray myLineValid;
bool myFirstLoad; bool myListIsDirty;
bool mySourceAvailable; bool mySourceAvailable;
int myCurrentBank; int myCurrentBank;
}; };

View File

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

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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> #include <algorithm>
@ -858,7 +858,7 @@ void EventHandler::handleMouseButtonEvent(SDL_Event& event, uInt8 state)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::handleJoyMouse(uInt32 time) 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) if (time >= myJoyMouse.last_time + myJoyMouse.delay_time)
{ {
@ -1004,7 +1004,7 @@ void EventHandler::handleJoyEvent(uInt8 stick, uInt32 code, uInt8 state)
} }
// Determine which mode we're in, then send the event to the appropriate place // Determine which mode we're in, then send the event to the appropriate place
// FIXME - this is almost exactly the same as handleKeyEvent // TODO - this is almost exactly the same as handleKeyEvent
// the similar code should be handled in handleEvent ... // the similar code should be handled in handleEvent ...
Event::Type event = myJoyTable[stick*kNumJoyButtons + code]; Event::Type event = myJoyTable[stick*kNumJoyButtons + code];
switch(myState) switch(myState)

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef FRAMEBUFFER_HXX
@ -52,7 +52,7 @@ enum FrameStyle {
All GUI elements (ala ScummVM) are drawn here as well. All GUI elements (ala ScummVM) are drawn here as well.
@author Stephen Anthony @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 class FrameBuffer
{ {
@ -221,8 +221,8 @@ class FrameBuffer
@param y The y coordinate @param y The y coordinate
@param w The width of the box @param w The width of the box
@param h The height of the box @param h The height of the box
@param colorA FIXME @param colorA Lighter color for outside line.
@param colorB FIXME @param colorB Darker color for inside line.
*/ */
void box(uInt32 x, uInt32 y, uInt32 w, uInt32 h, void box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
OverlayColor colorA, OverlayColor colorB); OverlayColor colorA, OverlayColor colorB);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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> #include <cassert>
@ -3261,7 +3261,7 @@ const uInt32 TIA::ourPALPalette11[256] = {
0x000000, 0x000000, 0x242424, 0x242424, 0x000000, 0x000000, 0x242424, 0x242424,
0x484848, 0x484848, 0x6d6d6d, 0x6d6d6d, 0x484848, 0x484848, 0x6d6d6d, 0x6d6d6d,
0x919191, 0x919191, 0xb6b6b6, 0xb6b6b6, 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 // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -39,6 +39,7 @@ enum {
* - to select the data dir for a game * - to select the data dir for a game
* - to select the place where save games are stored * - to select the place where save games are stored
* - others??? * - 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, _currentPath = new StaticTextWidget(this, 10, 20, _w - 2 * 10, kLineHeight,
"DUMMY", kTextAlignLeft); "DUMMY", kTextAlignLeft);
// Add file list FIXME_NOW // Add file list
_fileList = new StringListWidget(this, instance()->font(), _fileList = new StringListWidget(this, instance()->font(),
10, 34, _w - 2 * 10, _h - 34 - 24 - 10); 10, 34, _w - 2 * 10, _h - 34 - 24 - 10);
_fileList->setNumberingMode(kListNumberingOff); _fileList->setNumberingMode(kListNumberingOff);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -40,6 +40,10 @@
#include "bspf.hxx" #include "bspf.hxx"
/////////////////////////////////////////
// TODO - make this dialog font sensitive
/////////////////////////////////////////
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent, LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
int x, int y, int w, int h) int x, int y, int w, int h)
@ -91,7 +95,7 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
// Add list with game titles // Add list with game titles
myList = new StringListWidget(this, instance()->font(), 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->setNumberingMode(kListNumberingOff);
myList->setEditable(false); myList->setEditable(false);
myList->setFlags(WIDGET_NODRAW_FOCUS); myList->setFlags(WIDGET_NODRAW_FOCUS);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -97,8 +97,6 @@ LauncherOptionsDialog::LauncherOptionsDialog(
int baseW = instance()->frameBuffer().baseWidth(); int baseW = instance()->frameBuffer().baseWidth();
int baseH = instance()->frameBuffer().baseHeight(); int baseH = instance()->frameBuffer().baseHeight();
myBrowser = new BrowserDialog(this, 60, 20, baseW - 120, baseH - 40); 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 // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -215,7 +215,7 @@ void PopUpDialog::sendSelection()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PopUpDialog::isMouseDown() 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 // 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... // error prone. Would be much nicer to add an API to OSystem for this...