From 20b9253430b6e3262a59f5d8853df46bfbeab2b2 Mon Sep 17 00:00:00 2001 From: stephena Date: Tue, 30 Jul 2013 16:45:23 +0000 Subject: [PATCH] Moved TIA frame count update code to beginning of frame (instead of the end). Once a frame has started, it means a new frame should be added. This fixes a bug in the debugger UI whereby the frame count showed the previous value, since sometimes you could enter the debugger (with a cond BP) before the end of the frame was technically reached. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2773 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- Changes.txt | 3 +++ src/emucore/TIA.cxx | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Changes.txt b/Changes.txt index 5369d6a7e..92bddf8b6 100644 --- a/Changes.txt +++ b/Changes.txt @@ -20,6 +20,9 @@ the disassembler became confused and didn't properly track the PC address. + - Fixed bug in display of current TIA frame in the UI; depending on + how breakpoints were set, it was sometimes off by one. + - Changed display for various TIA position counters to decimal (from hex) in the TIA tab. Related to this, all data input widgets in the UI now have the ability to enter binary, diff --git a/src/emucore/TIA.cxx b/src/emucore/TIA.cxx index be60fff6d..b90228966 100644 --- a/src/emucore/TIA.cxx +++ b/src/emucore/TIA.cxx @@ -596,6 +596,7 @@ inline void TIA::startFrame() } } myStartScanline = 0; + myFrameCounter++; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -612,6 +613,7 @@ inline void TIA::endFrame() { // Skip display of this frame, as if it wasn't generated at all startFrame(); + myFrameCounter--; // This frame doesn't contribute to frame count return; } @@ -650,11 +652,6 @@ inline void TIA::endFrame() memset(myPreviousFrameBuffer + offset, 1, stride); } - // Stats counters - myFrameCounter++; - if(myScanlineCountForLastFrame >= 287) - myPALFrameCounter++; - // Recalculate framerate. attempting to auto-correct for scanline 'jumps' if(myAutoFrameEnabled) { @@ -669,6 +666,10 @@ inline void TIA::endFrame() if(offset > myStopDisplayOffset && offset < 228 * 320) myStopDisplayOffset = offset; } + + // Is this a PAL ROM? + if(myScanlineCountForLastFrame >= 287) + myPALFrameCounter++; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -