Added imperfect PAL scanline readout in debugger. It's quite possible that the NYSC version is imprecise to begin with.

This commit is contained in:
ugetab 2010-05-27 19:07:21 +00:00
parent ff284dd29c
commit 186a9544c8
2 changed files with 5 additions and 5 deletions

View File

@ -644,8 +644,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
vblankScanLines = (PAL?int((double)timestamp / ((double)341 / (double)3.2)):timestamp / 114); //114 approximates the number of timestamps per scanline during vblank. Approx 2508. NTSC: (341 / 3.0) PAL: (341 / 3.2). Uses (3.? * cpu_cycles) / 341.0, and assumes 1 cpu cycle.
if (vblankScanLines) vblankPixel = 341 / vblankScanLines; //341 pixels per scanline
//FCEUI_printf("vbPixel = %d",vblankPixel); //Debug
//FCEUI_printf("ts: %d line: %d\n", timestamp, vblankScanLines); //Debug
}

View File

@ -570,14 +570,14 @@ void UpdateDebugger()
ppupixel = 0; //Currently pixel display is borked until Run 128 lines is clicked, this keeps garbage from displaying
//If not in the 0-239 pixel range, make special cases for display
if (scanline == 240 && vblankScanLines < 22)
if (scanline == 240 && vblankScanLines < (PAL?72:22))
{
if (!vblankScanLines) //Idle scanline (240)
sprintf(str, "Idle %d\t %d",scanline,vblankPixel);
else if (scanline + vblankScanLines == 261)
else if (scanline + vblankScanLines == (PAL?311:261))
sprintf(str, "Prerender -1 %d", vblankPixel); //Pre-render
else
sprintf(str, "Vblank %d %d", scanline+vblankScanLines,vblankPixel); //Vblank lines (241-260)
sprintf(str, "Vblank %d %d", scanline+vblankScanLines,vblankPixel); //Vblank lines (241-260/310)
}
else
sprintf(str, "%d\t %d", scanline,ppupixel); //Scanlines 0 - 239