[Core/MD] added support for earlier revision of SF-001 mapper

This commit is contained in:
EkeEke 2013-02-26 20:30:52 +01:00 committed by twinaphex
parent 705360efbf
commit 210d19111b
4 changed files with 25 additions and 14 deletions

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Mega Drive cartridge hardware support * Mega Drive cartridge hardware support
* *
* Copyright (C) 2007-2011 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
* *
* Most cartridge protections were initially documented by Haze * Most cartridge protections were initially documented by Haze
* (http://haze.mameworld.info/) * (http://haze.mameworld.info/)
@ -904,8 +904,8 @@ static void mapper_sf001_w(uint32 address, uint32 data)
zbank_memory_map[i].read = NULL; zbank_memory_map[i].read = NULL;
} }
/* 256K ROM banks #2 to #15 mapped to $040000-$3BFFFF */ /* 256K ROM banks #2 to #15 mapped to $040000-$3BFFFF (last revision) or $040000-$3FFFFF (older revisions) */
for (i=0x04; i<0x3c; i++) for (i=0x04; i<(sram.start >> 16); i++)
{ {
m68k.memory_map[i].base = cart.rom + (i << 16); m68k.memory_map[i].base = cart.rom + (i << 16);
m68k.memory_map[i].read8 = NULL; m68k.memory_map[i].read8 = NULL;
@ -913,8 +913,8 @@ static void mapper_sf001_w(uint32 address, uint32 data)
zbank_memory_map[i].read = NULL; zbank_memory_map[i].read = NULL;
} }
/* 32K static RAM mirrored into $3C0000-$3FFFFF (odd bytes only) */ /* 32K static RAM mirrored into $3C0000-$3FFFFF (odd bytes only) (last revision only) */
for (i=0x3c; i<0x40; i++) while (i<0x40)
{ {
m68k.memory_map[i].base = sram.sram; m68k.memory_map[i].base = sram.sram;
m68k.memory_map[i].read8 = NULL; m68k.memory_map[i].read8 = NULL;
@ -923,11 +923,12 @@ static void mapper_sf001_w(uint32 address, uint32 data)
m68k.memory_map[i].write16 = NULL; m68k.memory_map[i].write16 = NULL;
zbank_memory_map[i].read = NULL; zbank_memory_map[i].read = NULL;
zbank_memory_map[i].write = NULL; zbank_memory_map[i].write = NULL;
i++;
} }
} }
else else
{ {
/* 256K ROM banks #1 to #16 mapped to $000000-$3FFFFF */ /* 256K ROM banks #1 to #16 mapped to $000000-$3FFFFF (default) */
for (i=0x00; i<0x40; i++) for (i=0x00; i<0x40; i++)
{ {
m68k.memory_map[i].base = cart.rom + (i << 16); m68k.memory_map[i].base = cart.rom + (i << 16);

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Mega Drive cartridge hardware support * Mega Drive cartridge hardware support
* *
* Copyright (C) 2007-2011 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
* *
* Most cartridge protections were initially documented by Haze * Most cartridge protections were initially documented by Haze
* (http://haze.mameworld.info/) * (http://haze.mameworld.info/)

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Backup RAM support * Backup RAM support
* *
* Copyright (C) 2007-2011 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
* *
* Redistribution and use of this code or any derivative works are permitted * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met:
@ -122,16 +122,26 @@ void sram_init()
{ {
/* Xin Qigai Wangzi (use uncommon area) */ /* Xin Qigai Wangzi (use uncommon area) */
sram.on = 1; sram.on = 1;
sram.start = 0x400000; sram.start = 0x400001;
sram.end = 0x40ffff; sram.end = 0x40ffff;
} }
else if ((strstr(rominfo.ROMType,"SF") != NULL) && (strstr(rominfo.product,"001") != NULL)) else if ((strstr(rominfo.ROMType,"SF") != NULL) && (strstr(rominfo.product,"001") != NULL))
{ {
/* SF-001 (use bankswitching) */ /* SF-001 */
sram.on = 1; sram.on = 1;
if (rominfo.checksum == 0x3e08)
{
/* last revision (use bankswitching) */
sram.start = 0x3c0001; sram.start = 0x3c0001;
sram.end = 0x3cffff; sram.end = 0x3cffff;
} }
else
{
/* older revisions (use uncommon area) */
sram.start = 0x400001;
sram.end = 0x40ffff;
}
}
else if ((strstr(rominfo.ROMType,"SF") != NULL) && (strstr(rominfo.product,"004") != NULL)) else if ((strstr(rominfo.ROMType,"SF") != NULL) && (strstr(rominfo.product,"004") != NULL))
{ {
/* SF-004 (use bankswitching) */ /* SF-004 (use bankswitching) */
@ -147,7 +157,7 @@ void sram_init()
/* Sonic 3 & Knuckles combined ROM */ /* Sonic 3 & Knuckles combined ROM */
/* it shows S&K header but should obviously use FRAM from Sonic 3 */ /* it shows S&K header but should obviously use FRAM from Sonic 3 */
sram.on = 1; sram.on = 1;
sram.start = 0x200000; sram.start = 0x200001;
sram.end = 0x203fff; sram.end = 0x203fff;
} }
} }

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Backup RAM support * Backup RAM support
* *
* Copyright (C) 2007-2011 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
* *
* Redistribution and use of this code or any derivative works are permitted * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met: