fix Uchuu Keibitai SDF in oldppu (broken in r3360)

This commit is contained in:
zeromus 2018-04-11 00:47:00 -05:00
parent bb5cd1527d
commit 9ff8ecb856
2 changed files with 9 additions and 9 deletions

View File

@ -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) {

View File

@ -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];