mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
sms, add sg-1000 on-cart RAM mapping
This commit is contained in:
parent
3611781e65
commit
216c9f17fa
1 changed files with 5 additions and 4 deletions
|
@ -458,15 +458,16 @@ static void write_bank_jang(unsigned short a, unsigned char d)
|
||||||
static void write_bank_x8k(unsigned short a, unsigned char d)
|
static void write_bank_x8k(unsigned short a, unsigned char d)
|
||||||
{
|
{
|
||||||
// 8KB address range @ 0x2000
|
// 8KB address range @ 0x2000
|
||||||
if ((a&0xe000) != 0x2000) return;
|
if ((a&0xe000) != 0x2000 && (a&0xe000) != 0x8000) return;
|
||||||
// this is only available on SG-1000
|
// this is only available on SG-1000
|
||||||
if (Pico.ms.mapper != PMS_MAP_8KBRAM && (Pico.ms.mapper || !(Pico.m.hardware & PMS_HW_SG))) return;
|
if (Pico.ms.mapper != PMS_MAP_8KBRAM && (Pico.ms.mapper || !(Pico.m.hardware & PMS_HW_SG))) return;
|
||||||
elprintf(EL_Z80BNK, "bank x8k %04x %02x @ %04x", a, d, z80_pc());
|
elprintf(EL_Z80BNK, "bank x8k %04x %02x @ %04x", a, d, z80_pc());
|
||||||
Pico.ms.mapper = PMS_MAP_8KBRAM;
|
Pico.ms.mapper = PMS_MAP_8KBRAM;
|
||||||
|
|
||||||
((unsigned char *)PicoMem.vram)[a+0x6000] = d;
|
((unsigned char *)PicoMem.vram)[(a&0x1fff)+0x8000] = d;
|
||||||
z80_map_set(z80_read_map, 0x2000, 0x3fff, PicoMem.vram+0x4000, 0);
|
a &= 0xe000;
|
||||||
z80_map_set(z80_write_map, 0x2000, 0x3fff, PicoMem.vram+0x4000, 0);
|
z80_map_set(z80_read_map, a, a+0x1fff, PicoMem.vram+0x4000, 0);
|
||||||
|
z80_map_set(z80_write_map, a, a+0x1fff, PicoMem.vram+0x4000, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO auto-selecting is not really reliable.
|
// TODO auto-selecting is not really reliable.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue