From b8320c2785f3483f3ada9fc27d74fa36e159c1fa Mon Sep 17 00:00:00 2001 From: stephena Date: Mon, 12 Jan 2009 15:11:55 +0000 Subject: [PATCH] Added the following pseudo-registers to the debugger: _fcount : current frame count _cclocks : frame color clocks _vsync : whether vsync is currently on (0 or 1) _vblank : whether vblank is currently on (0 or 1) Fixed issue with breakpoints starting the debugger causing a crash. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1614 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/debugger/TIADebug.hxx | 4 +++- stella/src/emucore/FrameBuffer.cxx | 7 ++++++- stella/src/yacc/YaccParser.cxx | 14 +++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/stella/src/debugger/TIADebug.hxx b/stella/src/debugger/TIADebug.hxx index 34e4d4d3a..469d206e1 100644 --- a/stella/src/debugger/TIADebug.hxx +++ b/stella/src/debugger/TIADebug.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: TIADebug.hxx,v 1.24 2009-01-01 18:13:35 stephena Exp $ +// $Id: TIADebug.hxx,v 1.25 2009-01-12 15:11:54 stephena Exp $ //============================================================================ #ifndef TIA_DEBUG_HXX @@ -205,6 +205,8 @@ class TIADebug : public DebuggerSystem int clocksThisLine(); bool vsync(); bool vblank(); + int vsyncAsInt() { return int(vsync()); } // so we can use _vsync pseudo-register + int vblankAsInt() { return int(vblank()); } // so we can use _vblank pseudo-register private: /** Display a color patch for color at given index in the palette */ diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index 7656dd757..f9afc2858 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.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: FrameBuffer.cxx,v 1.157 2009-01-10 18:52:55 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.158 2009-01-12 15:11:55 stephena Exp $ //============================================================================ #include @@ -158,7 +158,12 @@ void FrameBuffer::update() case EventHandler::S_EMULATE: { // Run the console for one frame + // Note that the debugger can cause a breakpoint to occur, which changes + // the EventHandler state 'behind our back' - we need to check for that myOSystem->console().mediaSource().update(); + #ifdef DEBUGGER_SUPPORT + if(myOSystem->eventHandler().state() != EventHandler::S_EMULATE) break; + #endif if(myOSystem->eventHandler().frying()) myOSystem->console().fry(); diff --git a/stella/src/yacc/YaccParser.cxx b/stella/src/yacc/YaccParser.cxx index aa26fe96f..99eca9aef 100644 --- a/stella/src/yacc/YaccParser.cxx +++ b/stella/src/yacc/YaccParser.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: YaccParser.cxx,v 1.25 2009-01-01 18:13:40 stephena Exp $ +// $Id: YaccParser.cxx,v 1.26 2009-01-12 15:11:55 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -214,6 +214,18 @@ TIADEBUG_INT_METHOD getTiaSpecial(char *c) { if(strcmp(c, "_scan") == 0) return &TIADebug::scanlines; + if(strcmp(c, "_fcount") == 0) + return &TIADebug::frameCount; + + if(strcmp(c, "_cclocks") == 0) + return &TIADebug::clocksThisLine; + + if(strcmp(c, "_vsync") == 0) + return &TIADebug::vsyncAsInt; + + if(strcmp(c, "_vblank") == 0) + return &TIADebug::vblankAsInt; + return 0; }