From 8b6c5f6d6a203ea8c0904ab822f78cf2b0a038e1 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 12 Mar 2009 22:09:50 +0000 Subject: [PATCH] Win32 - Debugger - PPU Pixels are displayed during vblank --- changelog.txt | 1 + src/debug.cpp | 4 +++- src/drivers/win/debugger.cpp | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 1d5c6bb6..aa0cac31 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---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 - 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 diff --git a/src/debug.cpp b/src/debug.cpp index 41b38490..7e95b319 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -16,7 +16,7 @@ #include "x6502abbrev.h" 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 offset = 0; @@ -617,6 +617,8 @@ void DebugCycle() { if (scanline == 240) { 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 } else diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index 0c5c45a0..3a01eac0 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -48,6 +48,7 @@ extern int myNumWPs; // ################################## End of SP CODE ########################### extern int vblankScanLines; +extern int vblankPixel; 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 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 sprintf(str, "Scanline %d, PPU pixel %d", scanline,ppupixel);