Ported FDS CDL fix to Qt GUI from win32.

This commit is contained in:
mjbudd77 2021-05-11 21:57:58 -04:00
parent 9b55e0a579
commit e9a85d2e1c
1 changed files with 16 additions and 3 deletions

View File

@ -640,16 +640,23 @@ void CodeDataLoggerDialog_t::SaveStrippedROM(int invert)
fwrite(&cdlhead, 1, 16, fp); 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++) for (i = 0; i < (int)cdloggerdataSize; i++)
{ {
unsigned char pchar; unsigned char pchar;
if (cdloggerdata[i] & 3) if (cdloggerdata[i] & 3)
{ {
pchar = invert ? 0 : PRGptr[0][i]; pchar = invert ? 0 : PRGptr[rom_sel][i];
} }
else else
{ {
pchar = invert ? PRGptr[0][i] : 0; pchar = invert ? PRGptr[rom_sel][i] : 0;
} }
fputc(pchar, fp); fputc(pchar, fp);
} }
@ -735,8 +742,14 @@ void FreeCDLog(void)
//---------------------------------------------------- //----------------------------------------------------
void InitCDLog(void) void InitCDLog(void)
{ {
int rom_sel = 0;
fceuWrapperLock(); fceuWrapperLock();
cdloggerdataSize = PRGsize[0]; if (GameInfo->type == GIT_FDS)
{
rom_sel = 1;
}
cdloggerdataSize = PRGsize[rom_sel];
cdloggerdata = (unsigned char *)malloc(cdloggerdataSize); cdloggerdata = (unsigned char *)malloc(cdloggerdataSize);
if (!CHRram[0] || (CHRptr[0] == PRGptr[0])) 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 { // Some kind of workaround for my OneBus VRAM hack, will remove it if I find another solution for that