little fix to more correct fds cdl
This commit is contained in:
parent
0b689d65c4
commit
a4fa6225a0
|
@ -214,11 +214,22 @@ int GetPRGAddress(int A){
|
|||
int result;
|
||||
if(A > 0xFFFF)
|
||||
return -1;
|
||||
result = &Page[A>>11][A]-PRGptr[0];
|
||||
if((result > (int)PRGsize[0]) || (result < 0))
|
||||
if (GameInfo->type == GIT_FDS) {
|
||||
if (A >= 0xE000)
|
||||
return -1;
|
||||
result = &Page[A >> 11][A] - PRGptr[1];
|
||||
if ((result > (int)PRGsize[1]) || (result < 0))
|
||||
return -1;
|
||||
else
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
result = &Page[A >> 11][A] - PRGptr[0];
|
||||
if ((result > (int)PRGsize[0]) || (result < 0))
|
||||
return -1;
|
||||
else
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -481,13 +492,25 @@ void LogCDData(uint8 *opcode, uint16 A, int size) {
|
|||
}
|
||||
|
||||
if((j = GetPRGAddress(A)) != -1) {
|
||||
if(!(cdloggerdata[j] & 2)) {
|
||||
if (opwrite[opcode[0]] == 0) {
|
||||
if (!(cdloggerdata[j] & 2)) {
|
||||
cdloggerdata[j] |= 2;
|
||||
cdloggerdata[j] |=(A>>11)&0x0c;
|
||||
cdloggerdata[j] |= (A >> 11) & 0x0c;
|
||||
cdloggerdata[j] |= memop;
|
||||
datacount++;
|
||||
if(!(cdloggerdata[j] & 1))undefinedcount--;
|
||||
if (!(cdloggerdata[j] & 1))undefinedcount--;
|
||||
}
|
||||
} /* else {
|
||||
if (cdloggerdata[j] & 1) {
|
||||
codecount--;
|
||||
if (!(cdloggerdata[j] & 2))undefinedcount--;
|
||||
}
|
||||
if (cdloggerdata[j] & 2) {
|
||||
datacount--;
|
||||
if (!(cdloggerdata[j] & 1))undefinedcount--;
|
||||
}
|
||||
cdloggerdata[j] = 0;
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -448,12 +448,16 @@ void SaveStrippedROM(int invert)
|
|||
|
||||
fwrite(&cdlhead,1,16,fp);
|
||||
|
||||
int rom_sel = 0;
|
||||
if (GameInfo->type == GIT_FDS)
|
||||
rom_sel = 1;
|
||||
cdloggerdataSize = PRGsize[rom_sel];
|
||||
for(i = 0; i < (int)cdloggerdataSize; i++){
|
||||
unsigned char pchar;
|
||||
if(cdloggerdata[i] & 3)
|
||||
pchar = invert?0:PRGptr[0][i];
|
||||
pchar = invert?0:PRGptr[rom_sel][i];
|
||||
else
|
||||
pchar = invert?PRGptr[0][i]:0;
|
||||
pchar = invert?PRGptr[rom_sel][i]:0;
|
||||
fputc(pchar, fp);
|
||||
}
|
||||
|
||||
|
@ -555,7 +559,10 @@ void FreeCDLog()
|
|||
|
||||
void InitCDLog()
|
||||
{
|
||||
cdloggerdataSize = PRGsize[0];
|
||||
int rom_sel = 0;
|
||||
if (GameInfo->type == GIT_FDS)
|
||||
rom_sel = 1;
|
||||
cdloggerdataSize = PRGsize[rom_sel];
|
||||
cdloggerdata = (unsigned char*)malloc(cdloggerdataSize);
|
||||
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];
|
||||
|
|
Loading…
Reference in New Issue