Skip to content

Commit

Permalink
fix for TASEmulators#68 (mapper 227 chr write protection emulation)
Browse files Browse the repository at this point in the history
  • Loading branch information
g0me3 committed Jul 22, 2019
1 parent 57d0b92 commit a3d4db6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/boards/addrlatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,15 @@ static void M227Sync(void) {
uint32 L = (latche >> 9) & 1;

if ((latche >> 7) & 1) {
SetupCartCHRMapping(0, CHRptr[0], 0x2000, 0); // hacky hacky write protection for CHR
if (S) {
setprg32(0x8000, p >> 1);
} else {
setprg16(0x8000, p);
setprg16(0xC000, p);
}
} else {
SetupCartCHRMapping(0, CHRptr[0], 0x2000, 1); // hacky hacky write protection for CHR
if (S) {
if (L) {
setprg16(0x8000, p & 0x3E);
Expand Down

0 comments on commit a3d4db6

Please sign in to comment.