Skip to content

Commit

Permalink
sms, add sram in codemasters mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
irixxxx committed Jun 30, 2024
1 parent 40172b9 commit 25559e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pico/sms.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static void write_bank_sega(unsigned short a, unsigned char d)
}
}

// Codemasters mapper. Similar to Sega, but different addresses, TODO: SRAM
// Codemasters mapper. Similar to Sega, but different addresses
static void write_bank_codem(unsigned short a, unsigned char d)
{
if (a >= 0xc000 || (a & 0x3fff)) return; // address is 0x0000, 0x4000, 0x8000?
Expand All @@ -352,6 +352,14 @@ static void write_bank_codem(unsigned short a, unsigned char d)

d &= bank_mask;
z80_map_set(z80_read_map, a, a+0x3fff, Pico.rom + (d << 14), 0);
if (Pico.ms.carthw[1] & 0x80) {
z80_map_set(z80_read_map, 0xa000, 0xbfff, PicoMem.vram+0x4000, 0);
z80_map_set(z80_write_map, 0xa000, 0xbfff, PicoMem.vram+0x4000, 0);
} else {
d = Pico.ms.carthw[2] & bank_mask;
z80_map_set(z80_read_map, 0xa000, 0xbfff, Pico.rom + (d << 14)+0x2000, 0);
z80_map_set(z80_write_map, 0xa000, 0xbfff, xwrite, 1);
}
}

// MSX mapper. 4 selectable 8KB banks at the top
Expand Down

0 comments on commit 25559e5

Please sign in to comment.