diff --git a/trunk/src/debug.h b/trunk/src/debug.h index bd5472aa..f80a6873 100644 --- a/trunk/src/debug.h +++ b/trunk/src/debug.h @@ -117,8 +117,6 @@ extern void IncrementInstructionsCounters(); extern uint8 *vnapage[4],*VPage[8]; extern uint8 PPU[4],PALRAM[0x20],SPRAM[0x100],VRAMBuffer,PPUGenLatch,XOffset; extern uint32 FCEUPPU_PeekAddress(); - -extern int debug_loggingCD; extern int numWPs; ///encapsulates the operational state of the debugger core diff --git a/trunk/src/drivers/win/cdlogger.cpp b/trunk/src/drivers/win/cdlogger.cpp index 4529e676..22f8098e 100644 --- a/trunk/src/drivers/win/cdlogger.cpp +++ b/trunk/src/drivers/win/cdlogger.cpp @@ -554,13 +554,13 @@ void FreeCDLog() if (cdloggerdata) { free(cdloggerdata); - cdloggerdata = 0; + cdloggerdata = NULL; cdloggerdataSize = 0; } if (cdloggervdata) { free(cdloggervdata); - cdloggervdata = 0; + cdloggervdata = NULL; cdloggerVideoDataSize = 0; } } diff --git a/trunk/src/drivers/win/ppuview.cpp b/trunk/src/drivers/win/ppuview.cpp index 8d220ad5..a36d816c 100644 --- a/trunk/src/drivers/win/ppuview.cpp +++ b/trunk/src/drivers/win/ppuview.cpp @@ -20,6 +20,7 @@ #include "common.h" #include "ppuview.h" +#include "../../debug.h" #include "../../palette.h" #include "../../fceu.h" #include "../../cart.h" @@ -117,7 +118,7 @@ void DrawPatternTable(uint8 *bitmap, uint8 *table, uint8 *log, uint8 pal) chr1 = table[index + 8]; logs = log[index] & log[index + 8]; tmp = 7; - shift=(PPUView_maskUnusedGraphics /*&& cdloggerVideoDataSize*/ && (((logs & 3) != 0) == PPUView_invertTheMask))?3:0; + shift=(PPUView_maskUnusedGraphics && debug_loggingCD && (((logs & 3) != 0) == PPUView_invertTheMask))?3:0; for (x = 0; x < 8; x++) { p = (chr0 >> tmp) & 1; @@ -157,19 +158,20 @@ void FCEUD_UpdatePPUView(int scanline, int refreshchr) { chrcache0[i] = VPage[i>>10][i]; chrcache1[i] = VPage[x>>10][x]; - if (cdloggerVideoDataSize) - { - int addr; - addr = &VPage[i >> 10][i] - CHRptr[0]; - if ((addr >= 0) && (addr < (int)cdloggerVideoDataSize)) - logcache0[i] = cdloggervdata[addr]; - addr = &VPage[x >> 10][x] - CHRptr[0]; - if ((addr >= 0) && (addr < (int)cdloggerVideoDataSize)) - logcache1[i] = cdloggervdata[addr]; - } else - { - logcache0[i] = cdloggervdata[i]; - logcache1[i] = cdloggervdata[x]; + if (debug_loggingCD) { + if (cdloggerVideoDataSize) + { + int addr; + addr = &VPage[i >> 10][i] - CHRptr[0]; + if ((addr >= 0) && (addr < (int)cdloggerVideoDataSize)) + logcache0[i] = cdloggervdata[addr]; + addr = &VPage[x >> 10][x] - CHRptr[0]; + if ((addr >= 0) && (addr < (int)cdloggerVideoDataSize)) + logcache1[i] = cdloggervdata[addr]; + } else { + logcache0[i] = cdloggervdata[i]; + logcache1[i] = cdloggervdata[x]; + } } } } diff --git a/trunk/src/ppu.cpp b/trunk/src/ppu.cpp index a567294a..528d970c 100644 --- a/trunk/src/ppu.cpp +++ b/trunk/src/ppu.cpp @@ -423,7 +423,7 @@ inline void FFCEUX_PPUWrite_Default(uint32 A, uint8 V) { } volatile int rendercount, vromreadcount, undefinedvromcount, LogAddress = -1; -unsigned char *cdloggervdata; +unsigned char *cdloggervdata = NULL; unsigned int cdloggerVideoDataSize = 0; int GetCHRAddress(int A) {