From 9ff8ecb8564ad6f94a84096fa90e4cd8b8de507b Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 11 Apr 2018 00:47:00 -0500 Subject: [PATCH] fix Uchuu Keibitai SDF in oldppu (broken in r3360) --- src/boards/mmc5.cpp | 14 +++++++------- src/ppu.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/boards/mmc5.cpp b/src/boards/mmc5.cpp index 39feb939..d3388bdf 100644 --- a/src/boards/mmc5.cpp +++ b/src/boards/mmc5.cpp @@ -122,25 +122,25 @@ uint8* MMC5BGVRAMADR(uint32 A) { if(Sprite16) { - bool isPattern = !!PPUON; - if (newppu && ppuphase == PPUPHASE_OBJ && isPattern) + bool isPattern = PPUON; + if (ppuphase == PPUPHASE_OBJ && isPattern) return &ABANKS[(A) >> 10][(A)]; - if (newppu && ppuphase == PPUPHASE_BG && isPattern) + if (ppuphase == PPUPHASE_BG && isPattern) return &BBANKS[(A) >> 10][(A)]; else if(mmc5ABMode == 0) return &ABANKS[(A) >> 10][(A)]; else return &BBANKS[(A) >> 10][(A)]; } - else return &ABANKS[(A) >> 10][(A)]; + else return &ABANKS[(A) >> 10][(A)];; } if (!Sprite16) { if (mmc5ABMode == 0) - return MMC5SPRVRAMADR(A); + return &ABANKS[(A) >> 10][(A)]; else - return &MMC5BGVPage[(A) >> 10][(A)]; - } else return &MMC5BGVPage[(A) >> 10][(A)]; + return &BBANKS[(A) >> 10][(A)]; + } else return &BBANKS[(A) >> 10][(A)]; } static void mmc5_PPUWrite(uint32 A, uint8 V) { diff --git a/src/ppu.cpp b/src/ppu.cpp index 7a2ccaf9..ed401d67 100644 --- a/src/ppu.cpp +++ b/src/ppu.cpp @@ -374,7 +374,7 @@ uint8 UPALRAM[0x03];//for 0x4/0x8/0xC addresses in palette, the ones in #define MMC5SPRVRAMADR(V) &MMC5SPRVPage[(V) >> 10][(V)] #define VRAMADR(V) &VPage[(V) >> 10][(V)] -extern uint8* MMC5BGVRAMADR(uint32 A); +uint8* MMC5BGVRAMADR(uint32 A); //this duplicates logic which is embedded in the ppu rendering code //which figures out where to get CHR data from depending on various hack modes @@ -770,7 +770,7 @@ static DECLFR(A2007) { if (debug_loggingCD) LogAddress = GetCHRAddress(tmp); - if(MMC5Hack) + if(MMC5Hack && newppu) VRAMBuffer = *MMC5BGVRAMADR(tmp); else VRAMBuffer = VPage[tmp >> 10][tmp];