From 4a1e4b642353bb721bf9571276a4354bee1b5f47 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 29 Apr 2017 05:38:32 +0000 Subject: [PATCH] mmc5: use PPUON instead of spriteon and screenon --- trunk/src/boards/mmc5.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/trunk/src/boards/mmc5.cpp b/trunk/src/boards/mmc5.cpp index 5ff134b1..27ccd66e 100644 --- a/trunk/src/boards/mmc5.cpp +++ b/trunk/src/boards/mmc5.cpp @@ -26,6 +26,7 @@ #define BBANKS MMC5BGVPage #define SpriteON (PPU[1] & 0x10) //Show Sprite #define ScreenON (PPU[1] & 0x08) //Show screen +#define PPUON (PPU[1] & 0x18) //PPU should operate static void (*sfun)(int P); static void (*psfun)(void); @@ -117,9 +118,10 @@ typedef struct __cartdata { static inline uint8 * MMC5BGVRAMADR(uint32 A) { if(Sprite16) { - if (ppuphase == PPUPHASE_OBJ && SpriteON) + bool isPattern = PPUON; + if (ppuphase == PPUPHASE_OBJ && isPattern) return &ABANKS[(A) >> 10][(A)]; - if (ppuphase == PPUPHASE_BG && ScreenON) + if (ppuphase == PPUPHASE_BG && isPattern) return &BBANKS[(A) >> 10][(A)]; else if(mmc5ABMode == 0) return &ABANKS[(A) >> 10][(A)]; @@ -174,9 +176,10 @@ uint8 FASTCALL mmc5_PPURead(uint32 A) { if(Sprite16) { - if (ppuphase == PPUPHASE_OBJ && SpriteON) + bool isPattern = PPUON; + if (ppuphase == PPUPHASE_OBJ && isPattern) return ABANKS[(A) >> 10][(A)]; - if (ppuphase == PPUPHASE_BG && ScreenON) + if (ppuphase == PPUPHASE_BG && isPattern) { if(split) return MMC5HackVROMPTR[MMC5HackSPPage*0x1000 + (A&0xFFF)];