mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 03:31:49 +01:00
[Core/SG] fixed state loading for games using external RAM
This commit is contained in:
parent
5f8156ef72
commit
aa9300d581
@ -741,15 +741,30 @@ int sms_cart_context_save(uint8 *state)
|
||||
{
|
||||
int bufferptr = 0;
|
||||
|
||||
/* check if cartridge ROM is disabled */
|
||||
if (io_reg[0x0E] & 0x40)
|
||||
{
|
||||
/* save Boot ROM mapper settings */
|
||||
save_param(bios_rom.fcr, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* save cartridge mapper settings */
|
||||
save_param(cart_rom.fcr, 4);
|
||||
}
|
||||
|
||||
/* support for SG-1000 games with extra RAM */
|
||||
if ((cart_rom.mapper == MAPPER_RAM_8K) || (cart_rom.mapper == MAPPER_RAM_8K_EXT1))
|
||||
{
|
||||
/* 8KB extra RAM */
|
||||
save_param(work_ram + 0x2000, 0x2000);
|
||||
}
|
||||
else if (cart_rom.mapper == MAPPER_RAM_2K)
|
||||
{
|
||||
/* 2KB extra RAM */
|
||||
save_param(work_ram + 0x2000, 0x800);
|
||||
}
|
||||
|
||||
return bufferptr;
|
||||
}
|
||||
|
||||
@ -757,15 +772,30 @@ int sms_cart_context_load(uint8 *state)
|
||||
{
|
||||
int bufferptr = 0;
|
||||
|
||||
/* check if cartridge ROM is disabled */
|
||||
if (io_reg[0x0E] & 0x40)
|
||||
{
|
||||
/* load Boot ROM mapper settings */
|
||||
load_param(bios_rom.fcr, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* load cartridge mapper settings */
|
||||
load_param(cart_rom.fcr, 4);
|
||||
}
|
||||
|
||||
/* support for SG-1000 games with extra RAM */
|
||||
if ((cart_rom.mapper == MAPPER_RAM_8K) || (cart_rom.mapper == MAPPER_RAM_8K_EXT1))
|
||||
{
|
||||
/* 8KB extra RAM */
|
||||
load_param(work_ram + 0x2000, 0x2000);
|
||||
}
|
||||
else if (cart_rom.mapper == MAPPER_RAM_2K)
|
||||
{
|
||||
/* 2KB extra RAM */
|
||||
load_param(work_ram + 0x2000, 0x800);
|
||||
}
|
||||
|
||||
return bufferptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user