sms, improved mapper support (more, menu option)

This commit is contained in:
kub 2021-10-28 18:57:09 +02:00
parent 68e7a5c1c0
commit f9ea940fb5
7 changed files with 206 additions and 55 deletions

View file

@ -528,12 +528,14 @@ static int menu_loop_32x_options(int id, int keys)
#ifndef NO_SMS
static const char *sms_hardwares[] = { "auto", "Game Gear", "Master System", NULL };
static const char *sms_mappers[] = { "auto", "Sega", "Codemasters", "Korea", "Korea MSX", "Korea X-in-1", "Korea 4-Pak", "Korea Janggun", "Korea Nemesis", NULL };
static const char h_smsfm[] = "FM sound is only supported by few games\nOther games may crash with FM enabled";
static menu_entry e_menu_sms_options[] =
{
mee_enum ("System", MA_SMSOPT_HARDWARE, PicoIn.hwSelect, sms_hardwares ),
mee_enum ("System", MA_SMSOPT_HARDWARE, PicoIn.hwSelect, sms_hardwares),
mee_onoff_h ("FM Sound Unit", MA_OPT2_ENABLE_YM2413, PicoIn.opt, POPT_EN_YM2413, h_smsfm),
mee_enum ("Cartridge mapping", MA_SMSOPT_MAPPER, PicoIn.mapper, sms_mappers),
mee_end,
};

View file

@ -88,6 +88,7 @@ typedef enum
MA_32XOPT_MSH2_CYCLES,
MA_32XOPT_SSH2_CYCLES,
MA_SMSOPT_HARDWARE,
MA_SMSOPT_MAPPER,
MA_CTRL_PLAYER1,
MA_CTRL_PLAYER2,
MA_CTRL_EMU,

View file

@ -1483,6 +1483,29 @@ static void update_variables(bool first_run)
PicoIn.opt &= ~POPT_EN_YM2413;
}
var.value = NULL;
var.key = "picodrive_smsmapper";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
if (strcmp(var.value, "Auto") == 0)
PicoIn.hwSelect = PMS_MAP_AUTO;
else if (strcmp(var.value, "Codemasters") == 0)
PicoIn.hwSelect = PMS_MAP_CODEM;
else if (strcmp(var.value, "Korea") == 0)
PicoIn.hwSelect = PMS_MAP_KOREA;
else if (strcmp(var.value, "Korea MSX") == 0)
PicoIn.hwSelect = PMS_MAP_MSX;
else if (strcmp(var.value, "Korea X-in-1") == 0)
PicoIn.hwSelect = PMS_MAP_N32K;
else if (strcmp(var.value, "Korea 4-Pak") == 0)
PicoIn.hwSelect = PMS_MAP_N16K;
else if (strcmp(var.value, "Korea Janggun") == 0)
PicoIn.hwSelect = PMS_MAP_JANGGUN;
else if (strcmp(var.value, "Korea Nemesis") == 0)
PicoIn.hwSelect = PMS_MAP_NEMESIS;
else
PicoIn.hwSelect = PMS_MAP_SEGA;
}
OldPicoRegionOverride = PicoIn.regionOverride;
var.value = NULL;
var.key = "picodrive_region";

View file

@ -84,6 +84,7 @@ struct retro_core_option_definition option_defs_us[] = {
},
"disabled"
},
{
"picodrive_smstype",
"Master System type",
"Choose which type of system the core should emulate for Master system",
@ -94,6 +95,7 @@ struct retro_core_option_definition option_defs_us[] = {
{ NULL, NULL },
},
"Auto"
},
{
"picodrive_smsfm",
"Master System FM sound unit",
@ -105,6 +107,24 @@ struct retro_core_option_definition option_defs_us[] = {
},
"off"
},
{
"picodrive_smsmapper",
"Master System ROM mapping",
"Choose which ROM mapper the core should apply. Auto will work for a wide range, but in some cases automatic detection fails.",
{
{ "Auto", NULL },
{ "Sega", NULL },
{ "Codemasters", NULL },
{ "Korea", NULL },
{ "Korea MSX", NULL },
{ "Korea X-in-1", NULL },
{ "Korea 4-Pak", NULL },
{ "Korea Janggun", NULL },
{ "Korea Nemesis", NULL },
{ NULL, NULL },
},
"Auto"
},
{
"picodrive_region",
"Region",