mirror of https://github.com/stella-emu/stella.git
Fixed '-break' commandline argument causing segfaults.
Fixed bug with Cheetah codes not working from the commandline or prompt. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@868 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
6785b1fdd3
commit
9db2d71cda
|
@ -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: mainSDL.cxx,v 1.51 2005-09-16 18:15:44 stephena Exp $
|
||||
// $Id: mainSDL.cxx,v 1.52 2005-10-27 19:15:14 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <fstream>
|
||||
|
@ -59,6 +59,10 @@
|
|||
#error Unsupported platform!
|
||||
#endif
|
||||
|
||||
#ifdef DEVELOPER_SUPPORT
|
||||
#include "Debugger.hxx"
|
||||
#endif
|
||||
|
||||
static void SetupProperties(PropertiesSet& set);
|
||||
static void Cleanup();
|
||||
|
||||
|
@ -211,8 +215,31 @@ int main(int argc, char* argv[])
|
|||
if(theOSystem->settings().getBool("holdbutton0"))
|
||||
theOSystem->eventHandler().handleEvent(Event::JoystickZeroFire, 1);
|
||||
|
||||
#ifdef DEVELOPER_SUPPORT
|
||||
Debugger& dbg = theOSystem->debugger();
|
||||
|
||||
// Set up any breakpoint that was on the command line
|
||||
// (and remove the key from the settings, so they won't get set again)
|
||||
string initBreak = theOSystem->settings().getString("break");
|
||||
if(initBreak != "")
|
||||
{
|
||||
int bp = dbg.stringToValue(initBreak);
|
||||
dbg.setBreakPoint(bp, true);
|
||||
theOSystem->settings().setString("break", "", false);
|
||||
}
|
||||
|
||||
// Set up any cheeetah code that was on the command line
|
||||
// (and remove the key from the settings, so they won't get set again)
|
||||
string cheetah = theOSystem->settings().getString("cheetah");
|
||||
if(cheetah != "")
|
||||
{
|
||||
dbg.run("cheetah " + cheetah);
|
||||
theOSystem->settings().setString("cheetah", "", false);
|
||||
}
|
||||
|
||||
if(theOSystem->settings().getBool("debug"))
|
||||
handler.enterDebugMode();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Start the main loop, and don't exit until the user issues a QUIT command
|
||||
|
|
|
@ -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.103 2005-10-22 15:43:16 stephena Exp $
|
||||
// $Id: Debugger.cxx,v 1.104 2005-10-27 19:15:14 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include "bspf.hxx"
|
||||
|
@ -148,18 +148,6 @@ void Debugger::initialize()
|
|||
myTiaZoom = dd->tiaZoom();
|
||||
myRom = dd->rom();
|
||||
myMessage = dd->message();
|
||||
|
||||
// set up any breakpoint that was on the command line
|
||||
// (and remove the key from the settings, so they won't get set again)
|
||||
string initBreak = myOSystem->settings().getString("break");
|
||||
if(initBreak != "") run("break " + initBreak);
|
||||
myOSystem->settings().setString("break", "", false);
|
||||
|
||||
// set up any cheeetah code that was on the command line
|
||||
// (and remove the key from the settings, so they won't get set again)
|
||||
string cheetah = myOSystem->settings().getString("cheetah");
|
||||
if(cheetah != "") run("cheetah " + cheetah);
|
||||
myOSystem->settings().setString("cheetah", "", false);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -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.86 2005-10-23 15:54:54 urchlay Exp $
|
||||
// $Id: DebuggerParser.cxx,v 1.87 2005-10-27 19:15:14 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include "bspf.hxx"
|
||||
|
@ -91,8 +91,7 @@ Command DebuggerParser::commands[] = {
|
|||
"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 },
|
||||
{ kARG_LABEL, kARG_END_ARGS },
|
||||
&DebuggerParser::executeCheetah
|
||||
},
|
||||
|
||||
|
@ -1353,7 +1352,6 @@ void DebuggerParser::executeBreak() {
|
|||
bp = debugger->cpuDebug().pc();
|
||||
else
|
||||
bp = args[0];
|
||||
|
||||
debugger->toggleBreakPoint(bp);
|
||||
debugger->myRom->invalidate();
|
||||
|
||||
|
|
Loading…
Reference in New Issue