implemented visual CHR data usage logging for VRAM-only games (mapper 2, etc). no cdl log save available, just display current used/unused tiles in ppu tile viewer. reset tile usage flags if rewritten by the program.
This commit is contained in:
parent
c73cf9eb63
commit
c50535a398
|
@ -93,7 +93,7 @@ static DECLFW(NROMWrite) {
|
|||
|
||||
static void NROMPower(void) {
|
||||
setprg8r(0x10, 0x6000, 0); // Famili BASIC (v3.0) need it (uses only 4KB), FP-BASIC uses 8KB
|
||||
setprg16(0x8000, 0);
|
||||
setprg16(0x8000, ~1);
|
||||
setprg16(0xC000, ~0);
|
||||
setchr8(0);
|
||||
|
||||
|
|
|
@ -572,8 +572,10 @@ void InitCDLog()
|
|||
if(!CHRram[0] || (CHRptr[0] == PRGptr[0])) { // Some kind of workaround for my OneBus VRAM hack, will remove it if I find another solution for that
|
||||
cdloggerVideoDataSize = CHRsize[0];
|
||||
cdloggervdata = (unsigned char*)malloc(cdloggerVideoDataSize);
|
||||
} else
|
||||
} else {
|
||||
cdloggerVideoDataSize = 0;
|
||||
cdloggervdata = (unsigned char*)malloc(8192);
|
||||
}
|
||||
}
|
||||
|
||||
void ResetCDLog()
|
||||
|
@ -581,10 +583,12 @@ void ResetCDLog()
|
|||
codecount = datacount = rendercount = vromreadcount = 0;
|
||||
undefinedcount = cdloggerdataSize;
|
||||
ZeroMemory(cdloggerdata, cdloggerdataSize);
|
||||
if(cdloggerVideoDataSize != 0)
|
||||
{
|
||||
if(cdloggerVideoDataSize != 0) {
|
||||
undefinedvromcount = cdloggerVideoDataSize;
|
||||
ZeroMemory(cdloggervdata, cdloggerVideoDataSize);
|
||||
} else {
|
||||
undefinedvromcount = 8192;
|
||||
ZeroMemory(cdloggervdata, 8192);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,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 /*&& cdloggerVideoDataSize*/ && (((logs & 3) != 0) == PPUView_invertTheMask))?3:0;
|
||||
for (x = 0; x < 8; x++)
|
||||
{
|
||||
p = (chr0 >> tmp) & 1;
|
||||
|
@ -168,8 +168,8 @@ void FCEUD_UpdatePPUView(int scanline, int refreshchr)
|
|||
logcache1[i] = cdloggervdata[addr];
|
||||
} else
|
||||
{
|
||||
logcache0[i] = 0;
|
||||
logcache1[i] = 0;
|
||||
logcache0[i] = cdloggervdata[i];
|
||||
logcache1[i] = cdloggervdata[x];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -431,7 +431,8 @@ int GetCHRAddress(int A) {
|
|||
int result = &VPage[A >> 10][A] - CHRptr[0];
|
||||
if ((result >= 0) && (result < (int)cdloggerVideoDataSize))
|
||||
return result;
|
||||
}
|
||||
} else
|
||||
if(A < 0x2000) return A;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -886,6 +887,13 @@ static DECLFW(B2006) {
|
|||
static DECLFW(B2007) {
|
||||
uint32 tmp = RefreshAddr & 0x3FFF;
|
||||
|
||||
if (debug_loggingCD) {
|
||||
if(tmp < 0x2000) {
|
||||
cdloggervdata[tmp] = 0;
|
||||
undefinedvromcount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (newppu) {
|
||||
PPUGenLatch = V;
|
||||
RefreshAddr = ppur.get_2007access() & 0x3FFF;
|
||||
|
|
Loading…
Reference in New Issue