Fix 128K CHR-ROM variants for VRC5

This commit is contained in:
negative 2024-01-13 09:30:42 +08:00
parent b53d087fca
commit d742620d72
No known key found for this signature in database
1 changed files with 7 additions and 2 deletions

View File

@ -87,9 +87,14 @@ pshift[1] <<= 8;
#else
#ifdef PPU_VRC5FETCH
if(tmpd & 0x40)
if(tmpd & 0x40) {
if (CHRsize[0] == (128 * 1024)) {
// NOTE: address 128K CHR-ROM using offsets into 256K CHR-ROM data
// https://www.nesdev.org/wiki/NES_2.0_Mapper_547#Kanji_ROM_layout
vadr = ((vadr & 0x00007) << 1) | ((vadr & 0x00010) >> 4) | ((vadr & 0x3FFE0) >> 1);
}
C = CHRptr[0] + vadr;
else
} else
C = VRAMADR(vadr);
#else
C = VRAMADR(vadr);