From fec77cf261cae6ac3b5ddc4ad57f295706f8ecb3 Mon Sep 17 00:00:00 2001 From: urchlay Date: Mon, 18 Jul 2005 23:00:18 +0000 Subject: [PATCH] "breakif" command now tells you which breakif number you've just set. You need the numbers so you can refer to them (e.g. delete them). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@673 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/debugger/DebuggerParser.cxx | 6 ++++-- stella/src/emucore/TIA.cxx | 3 ++- stella/src/emucore/m6502/src/M6502.cxx | 5 +++-- stella/src/emucore/m6502/src/M6502.hxx | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index 2c882b560..55b1f5cb7 100644 --- a/stella/src/debugger/DebuggerParser.cxx +++ b/stella/src/debugger/DebuggerParser.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: DebuggerParser.cxx,v 1.64 2005-07-18 02:03:40 urchlay Exp $ +// $Id: DebuggerParser.cxx,v 1.65 2005-07-18 23:00:16 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -1182,8 +1182,10 @@ void DebuggerParser::executeBreakif() { int res = YaccParser::parse(argStrings[0].c_str()); if(res == 0) { // I hate this().method().chaining().crap() - debugger->cpuDebug().m6502().addCondBreak( + unsigned int ret = debugger->cpuDebug().m6502().addCondBreak( YaccParser::getResult(), argStrings[0] ); + commandResult = "Added breakif "; + commandResult += debugger->valueToString(ret); } else { commandResult = red("invalid expression"); } diff --git a/stella/src/emucore/TIA.cxx b/stella/src/emucore/TIA.cxx index e1c74d03e..9eaea4636 100644 --- a/stella/src/emucore/TIA.cxx +++ b/stella/src/emucore/TIA.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: TIA.cxx,v 1.53 2005-07-17 00:04:00 stephena Exp $ +// $Id: TIA.cxx,v 1.54 2005-07-18 23:00:17 urchlay Exp $ //============================================================================ #include @@ -591,6 +591,7 @@ void TIA::updateScanline() do { mySystem->m6502().execute(1); clock = mySystem->cycles() * 3; + updateFrame(clock); } while(clock < endClock); totalClocks = (mySystem->cycles() * 3) - myClockWhenFrameStarted; diff --git a/stella/src/emucore/m6502/src/M6502.cxx b/stella/src/emucore/m6502/src/M6502.cxx index 60e3d218f..47f036a4c 100644 --- a/stella/src/emucore/m6502/src/M6502.cxx +++ b/stella/src/emucore/m6502/src/M6502.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: M6502.cxx,v 1.11 2005-07-18 02:03:41 urchlay Exp $ +// $Id: M6502.cxx,v 1.12 2005-07-18 23:00:18 urchlay Exp $ //============================================================================ #include "M6502.hxx" @@ -103,10 +103,11 @@ void M6502::stop() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void M6502::addCondBreak(Expression *e, string name) +unsigned int M6502::addCondBreak(Expression *e, string name) { myBreakConds.push_back(e); myBreakCondNames.push_back(name); + return myBreakConds.size() - 1; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/emucore/m6502/src/M6502.hxx b/stella/src/emucore/m6502/src/M6502.hxx index f3b8dc012..0d9d7cbb3 100644 --- a/stella/src/emucore/m6502/src/M6502.hxx +++ b/stella/src/emucore/m6502/src/M6502.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: M6502.hxx,v 1.10 2005-07-17 15:50:37 urchlay Exp $ +// $Id: M6502.hxx,v 1.11 2005-07-18 23:00:18 urchlay Exp $ //============================================================================ #ifndef M6502_HXX @@ -41,7 +41,7 @@ typedef GUI::Array ExpressionList; has a 64K addressing space. @author Bradford W. Mott - @version $Id: M6502.hxx,v 1.10 2005-07-17 15:50:37 urchlay Exp $ + @version $Id: M6502.hxx,v 1.11 2005-07-18 23:00:18 urchlay Exp $ */ class M6502 { @@ -187,7 +187,7 @@ class M6502 void setTraps(PackedBitArray *read, PackedBitArray *write); int totalInstructionCount() { return myTotalInstructionCount; } - void addCondBreak(Expression *e, string name); + unsigned int addCondBreak(Expression *e, string name); void delCondBreak(unsigned int brk); void clearCondBreaks(); const StringList getCondBreakNames();