[Core/MS] fixed savestate support when using Boot ROM

This commit is contained in:
ekeeke 2019-11-25 17:15:02 +01:00
parent eeea2039b6
commit f9161fbcee

View File

@ -777,11 +777,45 @@ int sms_cart_context_load(uint8 *state)
{ {
/* load Boot ROM mapper settings */ /* load Boot ROM mapper settings */
load_param(bios_rom.fcr, 4); load_param(bios_rom.fcr, 4);
/* set default cartridge ROM paging */
switch (cart_rom.mapper)
{
case MAPPER_SEGA:
case MAPPER_SEGA_X:
cart_rom.fcr[0] = 0;
cart_rom.fcr[1] = 0;
cart_rom.fcr[2] = 1;
cart_rom.fcr[3] = 2;
break;
case MAPPER_KOREA_8K:
case MAPPER_MSX:
case MAPPER_MSX_NEMESIS:
cart_rom.fcr[0] = 0;
cart_rom.fcr[1] = 0;
cart_rom.fcr[2] = 0;
cart_rom.fcr[3] = 0;
break;
default:
cart_rom.fcr[0] = 0;
cart_rom.fcr[1] = 0;
cart_rom.fcr[2] = 1;
cart_rom.fcr[3] = 0;
break;
}
} }
else else
{ {
/* load cartridge mapper settings */ /* load cartridge mapper settings */
load_param(cart_rom.fcr, 4); load_param(cart_rom.fcr, 4);
/* set default BIOS ROM paging (SEGA mapper by default) */
bios_rom.fcr[0] = 0;
bios_rom.fcr[1] = 0;
bios_rom.fcr[2] = 1;
bios_rom.fcr[3] = 2;
} }
/* support for SG-1000 games with extra RAM */ /* support for SG-1000 games with extra RAM */