fix CV3 in oldppu (regression from r3360). fixes #821

This commit is contained in:
zeromus 2018-04-01 17:38:41 +00:00
parent 5d7d99a3d9
commit 352b1747bd
1 changed files with 28 additions and 16 deletions

View File

@ -114,22 +114,33 @@ typedef struct __cartdata {
uint8 size;
} cartdata;
#define MMC5SPRVRAMADR(V) &MMC5SPRVPage[(V) >> 10][(V)]
uint8* MMC5BGVRAMADR(uint32 A)
{
if(Sprite16)
if(newppu)
{
bool isPattern = !!PPUON;
if (ppuphase == PPUPHASE_OBJ && isPattern)
return &ABANKS[(A) >> 10][(A)];
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)];
if(Sprite16)
{
bool isPattern = !!PPUON;
if (newppu && ppuphase == PPUPHASE_OBJ && isPattern)
return &ABANKS[(A) >> 10][(A)];
if (newppu && 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);
else
return &MMC5BGVPage[(A) >> 10][(A)];
} else return &MMC5BGVPage[(A) >> 10][(A)];
}
static void mmc5_PPUWrite(uint32 A, uint8 V) {
@ -241,11 +252,12 @@ uint8 FASTCALL mmc5_PPURead(uint32 A)
{
if((A&0x3FF)>=0x3C0)
{
uint8 byte = ExRAM[NTRefreshAddr & 0x3ff];
//get attribute part and paste it 4x across the byte
byte >>= 6;
byte *= 0x55;
return byte;
return ExRAM[NTRefreshAddr & 0x3ff];
//uint8 byte = ExRAM[NTRefreshAddr & 0x3ff];
////get attribute part and paste it 4x across the byte
//byte >>= 6;
//byte *= 0x55;
//return byte;
}
}