File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -353,16 +353,25 @@ static void M227Sync(void) {
353
353
uint32 p = ((latche >> 2 ) & 0x1F ) + ((latche & 0x100 ) >> 3 );
354
354
uint32 L = (latche >> 9 ) & 1 ;
355
355
356
+ // ok, according to nesdev wiki (refrenced to the nesdev dumping thread) there is a CHR write protection bit7.
357
+ // however, this bit clearly determined a specific PRG layout for some game but does not meant to have additional
358
+ // functionality. as I see from the menu code, it disables the chr writing before run an actual game.
359
+ // this fix here makes happy both waixing rpgs and multigame menus at once. can't veryfy it on a hardware
360
+ // but if I find some i'll definitly do this.
361
+
362
+ if ((latche & 0xF000 ) == 0xF000 )
363
+ SetupCartCHRMapping (0 , CHRptr[0 ], 0x2000 , 0 );
364
+ else
365
+ SetupCartCHRMapping (0 , CHRptr[0 ], 0x2000 , 1 );
366
+
356
367
if ((latche >> 7 ) & 1 ) {
357
- SetupCartCHRMapping (0 , CHRptr[0 ], 0x2000 , 0 ); // hacky hacky write protection for CHR
358
368
if (S) {
359
369
setprg32 (0x8000 , p >> 1 );
360
370
} else {
361
371
setprg16 (0x8000 , p);
362
372
setprg16 (0xC000 , p);
363
373
}
364
374
} else {
365
- SetupCartCHRMapping (0 , CHRptr[0 ], 0x2000 , 1 ); // hacky hacky write protection for CHR
366
375
if (S) {
367
376
if (L) {
368
377
setprg16 (0x8000 , p & 0x3E );
You can’t perform that action at this time.
0 commit comments