diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index 15e15758d..1e257616c 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.hxx @@ -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.85 2006-12-08 16:48:59 stephena Exp $ +// $Id: Debugger.hxx,v 1.86 2006-12-18 14:01:57 stephena Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -69,7 +69,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.85 2006-12-08 16:48:59 stephena Exp $ + @version $Id: Debugger.hxx,v 1.86 2006-12-18 14:01:57 stephena Exp $ */ class Debugger : public DialogContainer { @@ -159,12 +159,6 @@ class Debugger : public DialogContainer */ const string run(const string& command); - /** - Indicate if the debugger is currently running a command - (it shouldn't be exited in this case) - */ - bool isBlocked() { return myParser->commandRunning(); } - /** Give the contents of the CPU registers and disassembly of next instruction. diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index dcde27c25..733214bc0 100644 --- a/stella/src/debugger/DebuggerParser.cxx +++ b/stella/src/debugger/DebuggerParser.cxx @@ -13,10 +13,11 @@ // 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.94 2006-12-15 16:42:54 stephena Exp $ +// $Id: DebuggerParser.cxx,v 1.95 2006-12-18 14:01:57 stephena Exp $ //============================================================================ #include +#include #include "bspf.hxx" #include "Dialog.hxx" @@ -40,9 +41,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DebuggerParser::DebuggerParser(Debugger* d) - : debugger(d), - myRunningFlag(false), - myCancelFlag(false) + : debugger(d) { defaultBase = kBASE_16; } @@ -101,16 +100,13 @@ string DebuggerParser::run(const string& command) cerr << "Expression count: " << refCount << endl; #endif commandResult = ""; - myCancelFlag = false; for(int i = 0; i < kNumCommands; ++i) { if(verb == commands[i].cmdString) { - myRunningFlag = true; if(validateArgs(i)) CALL_METHOD(commands[i].executor); - myRunningFlag = false; if(commands[i].refreshRequired) debugger->myBaseDialog->loadConfig(); @@ -123,13 +119,6 @@ string DebuggerParser::run(const string& command) return commandResult; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void DebuggerParser::cancel() -{ - // Indicate to any blocking commands that it's time to quit - myCancelFlag = true; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string DebuggerParser::exec(const string& file, bool verbose) { @@ -1174,29 +1163,25 @@ void DebuggerParser::executeRun() // "runto" void DebuggerParser::executeRunTo() { + ostringstream buf; bool done = false; int cycles = 0, count = 0; do { - if(myCancelFlag) break; - cycles += debugger->step(); - - // This command can potentially block forever - // We should yield to the system, and check for cancellation - if(++count % 10000 == 0) - { - debugger->prompt()->putchar('.'); - debugger->getOSystem()->run(); - } - string next = debugger->disassemble(debugger->cpuDebug().pc(), 1); done = (next.find(argStrings[0]) != string::npos); - } while(!done); + ++count; + } while(!done && count < 10000); - commandResult = "executed "; - commandResult += debugger->valueToString(cycles); - commandResult += " cycles"; + if(done) + buf << "found " << argStrings[0] << " in " << debugger->valueToString(cycles) + << " cycles"; + else + buf << argStrings[0] << " not found in " << debugger->valueToString(count) + << " disassembled instructions"; + + commandResult = buf.str(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/debugger/DebuggerParser.hxx b/stella/src/debugger/DebuggerParser.hxx index bdd18e41f..72d5fe7ec 100644 --- a/stella/src/debugger/DebuggerParser.hxx +++ b/stella/src/debugger/DebuggerParser.hxx @@ -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.46 2006-12-08 16:49:00 stephena Exp $ +// $Id: DebuggerParser.hxx,v 1.47 2006-12-18 14:01:58 stephena Exp $ //============================================================================ #ifndef DEBUGGER_PARSER_HXX @@ -42,12 +42,6 @@ class DebuggerParser /** Run the given command, and return the result */ string run(const string& command); - /** Indicate if a command is currently running */ - bool commandRunning() { return myRunningFlag; } - - /** Cancel the currently running command, if any */ - void cancel(); - /** Execute parser commands given in 'file' */ string exec(const string& file, bool verbose = true); @@ -129,12 +123,6 @@ class DebuggerParser // The results of the currently running command string commandResult; - // Indicates whether a command is currently running, or a cancel - // event has been received - // Commands which expect to block for long periods of time should - // occasionally check the myCancelFlag - bool myRunningFlag, myCancelFlag; - // Arguments in 'int' and 'string' format for the currently running command IntArray args; StringList argStrings; diff --git a/stella/src/debugger/gui/PromptWidget.cxx b/stella/src/debugger/gui/PromptWidget.cxx index 966c0f38f..440a52217 100644 --- a/stella/src/debugger/gui/PromptWidget.cxx +++ b/stella/src/debugger/gui/PromptWidget.cxx @@ -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: PromptWidget.cxx,v 1.13 2006-12-15 16:42:55 stephena Exp $ +// $Id: PromptWidget.cxx,v 1.14 2006-12-18 14:01:58 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -521,10 +521,6 @@ void PromptWidget::specialKeys(int keycode) _currentPos = _promptStartPos; handled = true; break; - case 'c': - instance()->debugger().parser()->cancel(); - handled = true; - break; case 'd': killChar(+1); handled = true; diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 2c9877af9..2af4da8de 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -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.187 2006-12-15 16:42:57 stephena Exp $ +// $Id: EventHandler.cxx,v 1.188 2006-12-18 14:01:58 stephena Exp $ //============================================================================ #include @@ -2280,10 +2280,6 @@ void EventHandler::leaveDebugMode() if(myState != S_DEBUGGER) return; - // If for any reason a command is currently running, we can't exit the debugger - if(myOSystem->debugger().isBlocked()) - return; - // Make sure debugger quits in a consistent state myOSystem->debugger().setQuitState(); diff --git a/stella/src/emucore/OSystem.cxx b/stella/src/emucore/OSystem.cxx index 67cef03c6..f7961e7b6 100644 --- a/stella/src/emucore/OSystem.cxx +++ b/stella/src/emucore/OSystem.cxx @@ -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: OSystem.cxx,v 1.80 2006-12-15 16:42:58 stephena Exp $ +// $Id: OSystem.cxx,v 1.81 2006-12-18 14:01:58 stephena Exp $ //============================================================================ #include @@ -524,13 +524,6 @@ bool OSystem::openROM(const string& rom, string& md5, uInt8** image, int* size) return true; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void OSystem::run() const -{ - myEventHandler->poll(0); - myFrameBuffer->update(); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void OSystem::setDefaultJoymap() { diff --git a/stella/src/emucore/OSystem.hxx b/stella/src/emucore/OSystem.hxx index 48a772188..9323f4bf5 100644 --- a/stella/src/emucore/OSystem.hxx +++ b/stella/src/emucore/OSystem.hxx @@ -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: OSystem.hxx,v 1.46 2006-12-15 16:42:58 stephena Exp $ +// $Id: OSystem.hxx,v 1.47 2006-12-18 14:01:58 stephena Exp $ //============================================================================ #ifndef OSYSTEM_HXX @@ -45,7 +45,7 @@ class VideoDialog; other objects belong. @author Stephen Anthony - @version $Id: OSystem.hxx,v 1.46 2006-12-15 16:42:58 stephena Exp $ + @version $Id: OSystem.hxx,v 1.47 2006-12-18 14:01:58 stephena Exp $ */ class OSystem { @@ -271,16 +271,6 @@ class OSystem */ bool openROM(const string& rom, string& md5, uInt8** image, int* size); - /** - Runs through one iteration of the OSystem loop, which consists of - checking for events, rendering the framebuffer, etc. - This method isn't meant to be used from mainLoop(), but instead is - used as a sort of 'yield' function, whereby other parts of the code - may block for a time, and we need to check for cancellation (used - to emulate a poor man's threading system). - */ - void run() const; - public: ////////////////////////////////////////////////////////////////////// // The following methods are system-specific and must be implemented diff --git a/stella/src/unix/SettingsUNIX.cxx b/stella/src/unix/SettingsUNIX.cxx index 480390a2d..767e419c0 100644 --- a/stella/src/unix/SettingsUNIX.cxx +++ b/stella/src/unix/SettingsUNIX.cxx @@ -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: SettingsUNIX.cxx,v 1.19 2006-12-18 12:53:33 stephena Exp $ +// $Id: SettingsUNIX.cxx,v 1.20 2006-12-18 14:01:58 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -27,7 +27,10 @@ SettingsUNIX::SettingsUNIX(OSystem* osystem) // This argument is only valid for Linux/UNIX, and will eventually be removed setInternal("accurate", "false"); setInternal("gl_lib", "libGL.so"); - setInternal("gl_vsync", "false"); // Most Linux GL implementations don't support this yet + // Most Linux GL implementations don't support this yet + setInternal("gl_vsync", "false"); + // For whatever reason, this is very efficient in Linux + setInternal("dirtyrects", "true"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -