fix to prev, now all ROMs are happy

This commit is contained in:
g0me3 2019-07-22 13:48:49 +03:00
parent a3d4db6b1a
commit 1f5ce9e120
1 changed files with 11 additions and 2 deletions

View File

@ -353,8 +353,18 @@ static void M227Sync(void) {
uint32 p = ((latche >> 2) & 0x1F) + ((latche & 0x100) >> 3);
uint32 L = (latche >> 9) & 1;
// ok, according to nesdev wiki (refrenced to the nesdev dumping thread) there is a CHR write protection bit7.
// however, this bit clearly determined a specific PRG layout for some game but does not meant to have additional
// functionality. as I see from the menu code, it disables the chr writing before run an actual game.
// this fix here makes happy both waixing rpgs and multigame menus at once. can't veryfy it on a hardware
// but if I find some i'll definitly do this.
if ((latche & 0xF000) == 0xF000)
SetupCartCHRMapping(0, CHRptr[0], 0x2000, 0);
else
SetupCartCHRMapping(0, CHRptr[0], 0x2000, 1);
if ((latche >> 7) & 1) {
SetupCartCHRMapping(0, CHRptr[0], 0x2000, 0); // hacky hacky write protection for CHR
if (S) {
setprg32(0x8000, p >> 1);
} else {
@ -362,7 +372,6 @@ static void M227Sync(void) {
setprg16(0xC000, p);
}
} else {
SetupCartCHRMapping(0, CHRptr[0], 0x2000, 1); // hacky hacky write protection for CHR
if (S) {
if (L) {
setprg16(0x8000, p & 0x3E);