Skip to content

Commit

Permalink
Fixed mapper 561.
Browse files Browse the repository at this point in the history
  • Loading branch information
punesemu committed Mar 9, 2024
1 parent cc0032d commit e190af6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/core/mappers/mapper_561.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void map_init_561(void) {
if (info.reset >= HARD) {
memset(&m561, 0x00, sizeof(m561));

m561.reg1m = info.mapper.submapper << 5 | (info.mapper.mirroring == MIRRORING_VERTICAL ? 0x01: 0x11) | 0x02;
m561.reg1m = (info.mapper.submapper << 5) | (info.mapper.mirroring == MIRRORING_VERTICAL ? 0x01: 0x11) | 0x02;
m561.reg4m = 0x03;
m561.prg[0] = 0x1C;
m561.prg[1] = 0x1D;
Expand Down Expand Up @@ -94,7 +94,11 @@ void extcl_cpu_init_pc_561(BYTE nidx) {
data = miscrom_pnt_byte(4);
}

memcpy(wram_pnt_byte(address & 0x1FFF), data, size);
if (address < 0x2000) {
memcpy(ram_pnt_byte(nidx, address & 0x1FFF), data, size);
} else {
memcpy(wram_pnt_byte(address & 0x1FFF), data, size);
}

if (init) {
// JSR init
Expand Down Expand Up @@ -252,7 +256,7 @@ INLINE static void prg_fix_561(void) {
}
}
INLINE static void chr_fix_561(void) {
memmap_vram_wp_8k(0, MMPPU(0x0000), m561.chr, TRUE, !((m561.reg1m & 0xE0) & 0x80));
memmap_vram_wp_8k(0, MMPPU(0x0000), m561.chr, TRUE, !(m561.reg1m >= 0x80));
}
INLINE static void mirroring_fix_561(void) {
switch (m561.reg1m & 0x11) {
Expand Down

0 comments on commit e190af6

Please sign in to comment.