crash-fix to my last commit

This commit is contained in:
CaH4e3 2015-12-21 20:32:19 +00:00
parent 385ecbe2d6
commit 101ff8d79d
4 changed files with 19 additions and 19 deletions

View File

@ -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

View File

@ -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;
}
}

View File

@ -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];
}
}
}
}

View File

@ -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) {