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
This commit is contained in:
stephena 2013-07-30 16:45:23 +00:00
parent 270abc889d
commit 20b9253430
2 changed files with 9 additions and 5 deletions

View File

@ -20,6 +20,9 @@
the disassembler became confused and didn't properly track the the disassembler became confused and didn't properly track the
PC address. 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 - Changed display for various TIA position counters to decimal
(from hex) in the TIA tab. Related to this, all data input (from hex) in the TIA tab. Related to this, all data input
widgets in the UI now have the ability to enter binary, widgets in the UI now have the ability to enter binary,

View File

@ -596,6 +596,7 @@ inline void TIA::startFrame()
} }
} }
myStartScanline = 0; myStartScanline = 0;
myFrameCounter++;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -612,6 +613,7 @@ inline void TIA::endFrame()
{ {
// Skip display of this frame, as if it wasn't generated at all // Skip display of this frame, as if it wasn't generated at all
startFrame(); startFrame();
myFrameCounter--; // This frame doesn't contribute to frame count
return; return;
} }
@ -650,11 +652,6 @@ inline void TIA::endFrame()
memset(myPreviousFrameBuffer + offset, 1, stride); memset(myPreviousFrameBuffer + offset, 1, stride);
} }
// Stats counters
myFrameCounter++;
if(myScanlineCountForLastFrame >= 287)
myPALFrameCounter++;
// Recalculate framerate. attempting to auto-correct for scanline 'jumps' // Recalculate framerate. attempting to auto-correct for scanline 'jumps'
if(myAutoFrameEnabled) if(myAutoFrameEnabled)
{ {
@ -669,6 +666,10 @@ inline void TIA::endFrame()
if(offset > myStopDisplayOffset && offset < 228 * 320) if(offset > myStopDisplayOffset && offset < 228 * 320)
myStopDisplayOffset = offset; myStopDisplayOffset = offset;
} }
// Is this a PAL ROM?
if(myScanlineCountForLastFrame >= 287)
myPALFrameCounter++;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -