Merge pull request #686 from negativeExponent/vrc5_128k

Fix 128K CHR-ROM variants for VRC5
This commit is contained in:
thor2016 2024-02-23 07:34:17 -05:00 committed by GitHub
commit b25f56fe12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -87,9 +87,14 @@ pshift[1] <<= 8;
#else #else
#ifdef PPU_VRC5FETCH #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; C = CHRptr[0] + vadr;
else } else
C = VRAMADR(vadr); C = VRAMADR(vadr);
#else #else
C = VRAMADR(vadr); C = VRAMADR(vadr);