From 0708f60a7cf372c182291625584ec299dda7a27b Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 4 Nov 2015 18:49:40 +0000 Subject: [PATCH] try to give more granular accounting of scanline and dot for debugger --- trunk/src/drivers/win/debugger.cpp | 8 ++++++++ trunk/src/ppu.cpp | 21 ++++++++++++++++----- trunk/src/ppu.h | 3 +++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/trunk/src/drivers/win/debugger.cpp b/trunk/src/drivers/win/debugger.cpp index ee9d95f5..cb9d3d8f 100644 --- a/trunk/src/drivers/win/debugger.cpp +++ b/trunk/src/drivers/win/debugger.cpp @@ -26,6 +26,7 @@ #include "../../fceu.h" #include "../../debug.h" #include "../../nsf.h" +#include "../../ppu.h" #include "../../cart.h" #include "../../ines.h" #include "../../asm.h" @@ -891,6 +892,13 @@ void UpdateDebugger(bool jump_to_pc) sprintf(str, "%d", scanline); sprintf(str2, "%d", ppupixel); } + + if(newppu) + { + sprintf(str,"%d",newppu_get_scanline()); + sprintf(str2,"%d",newppu_get_dot()); + } + SetDlgItemText(hDebug, IDC_DEBUGGER_VAL_SLINE, str); SetDlgItemText(hDebug, IDC_DEBUGGER_VAL_PPUPIXEL, str2); diff --git a/trunk/src/ppu.cpp b/trunk/src/ppu.cpp index 3ad974bf..a615ce7d 100644 --- a/trunk/src/ppu.cpp +++ b/trunk/src/ppu.cpp @@ -276,6 +276,9 @@ struct PPUREGS { } } ppur; +int newppu_get_scanline() { return ppur.status.sl; } +int newppu_get_dot() { return ppur.status.cycle; } + static void makeppulut(void) { int x; int y; @@ -2024,12 +2027,20 @@ int FCEUX_PPU_Loop(int skip) { ppur.status.sl = 241; //for sprite reads - runppu(delay); //X6502_Run(12); + //formerly: runppu(delay); + for(int dot=0;dot