Win32 - Debugger - PPU Pixels are displayed during vblank

This commit is contained in:
adelikat 2009-03-12 22:09:50 +00:00
parent 48c3f49058
commit 8b6c5f6d6a
3 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.4 yet to be released--- ---version 2.0.4 yet to be released---
13-mar-2009 - adelikat - Win32 - Debugger - Scanlines and PPU Pixels are displayed even in vblank (lines 240-261)
12-mar-2009 - shinydoofy - sdl - fixed compilation error and reactivated the mouse pointer in the SDL window 12-mar-2009 - shinydoofy - sdl - fixed compilation error and reactivated the mouse pointer in the SDL window
12-mar-2009 - adelikat - Win32 - Trace Logger - fixed bug where user can't scroll the log window while it is auto-updating 12-mar-2009 - adelikat - Win32 - Trace Logger - fixed bug where user can't scroll the log window while it is auto-updating
11-mar-2009 - adelikat - Win32 - Trace Logger - changed message about F2 pause (left over from FCEUXDSP) to display the current hotkey mapping 11-mar-2009 - adelikat - Win32 - Trace Logger - changed message about F2 pause (left over from FCEUXDSP) to display the current hotkey mapping

View File

@ -16,7 +16,7 @@
#include "x6502abbrev.h" #include "x6502abbrev.h"
int vblankScanLines = 0; //Used to calculate scanlines 240-261 (vblank) int vblankScanLines = 0; //Used to calculate scanlines 240-261 (vblank)
int vblankPixel = 0; //Used to calculate the pixels in vblank
int offsetStringToInt(unsigned int type, const char* offsetBuffer) int offsetStringToInt(unsigned int type, const char* offsetBuffer)
{ {
int offset = 0; int offset = 0;
@ -617,6 +617,8 @@ void DebugCycle() {
if (scanline == 240) if (scanline == 240)
{ {
vblankScanLines = (timestamp / 114); //114 approximates the number of timestamps per scanline during vblank. Approx 2508 vblankScanLines = (timestamp / 114); //114 approximates the number of timestamps per scanline during vblank. Approx 2508
if (vblankScanLines) vblankPixel = 341 / vblankScanLines; //314 pixels per scanline
//FCEUI_printf("vbPixel = %d",vblankPixel); //Debug
//FCEUI_printf("ts: %d line: %d\n", timestamp, vblankScanLines); //Debug //FCEUI_printf("ts: %d line: %d\n", timestamp, vblankScanLines); //Debug
} }
else else

View File

@ -48,6 +48,7 @@ extern int myNumWPs;
// ################################## End of SP CODE ########################### // ################################## End of SP CODE ###########################
extern int vblankScanLines; extern int vblankScanLines;
extern int vblankPixel;
int childwnd; int childwnd;
@ -547,7 +548,7 @@ void UpdateDebugger()
ppupixel = 0; //Currently pixel display is borked until Run 128 lines is clicked, this keeps garbage from displaying ppupixel = 0; //Currently pixel display is borked until Run 128 lines is clicked, this keeps garbage from displaying
if (scanline == 240 && vblankScanLines < 22) if (scanline == 240 && vblankScanLines < 22)
sprintf(str, "Scanline %d, PPU pixel %d", scanline+vblankScanLines,ppupixel); sprintf(str, "Scanline %d, PPU pixel %d", scanline+vblankScanLines,vblankPixel);
else else
sprintf(str, "Scanline %d, PPU pixel %d", scanline,ppupixel); sprintf(str, "Scanline %d, PPU pixel %d", scanline,ppupixel);