mirror of https://github.com/mgba-emu/mgba.git
Libretro: Allow choosing the Game Boy model
This commit is contained in:
parent
ea2159d159
commit
eddd3851bc
|
@ -63,6 +63,27 @@ static void _reloadSettings(void) {
|
|||
};
|
||||
|
||||
struct retro_variable var;
|
||||
enum GBModel model;
|
||||
const char* modelName;
|
||||
|
||||
var.key = "mgba_model";
|
||||
var.value = 0;
|
||||
if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
|
||||
if (strcmp(var.value, "Game Boy") == 0) {
|
||||
model = GB_MODEL_DMG;
|
||||
} else if (strcmp(var.value, "Super Game Boy") == 0) {
|
||||
model = GB_MODEL_SGB;
|
||||
} else if (strcmp(var.value, "Game Boy Color") == 0) {
|
||||
model = GB_MODEL_CGB;
|
||||
} else {
|
||||
model = GB_MODEL_AUTODETECT;
|
||||
}
|
||||
|
||||
modelName = GBModelToName(model);
|
||||
mCoreConfigSetDefaultValue(&core->config, "gb.model", modelName);
|
||||
mCoreConfigSetDefaultValue(&core->config, "sgb.model", modelName);
|
||||
mCoreConfigSetDefaultValue(&core->config, "cgb.model", modelName);
|
||||
}
|
||||
|
||||
var.key = "mgba_use_bios";
|
||||
var.value = 0;
|
||||
|
@ -119,6 +140,7 @@ void retro_set_environment(retro_environment_t env) {
|
|||
struct retro_variable vars[] = {
|
||||
{ "mgba_solar_sensor_level", "Solar sensor level; 0|1|2|3|4|5|6|7|8|9|10" },
|
||||
{ "mgba_allow_opposing_directions", "Allow opposing directional input; OFF|ON" },
|
||||
{ "mgba_model", "Game Boy model (requires restart); Autodetect|Game Boy|Super Game Boy|Game Boy Color" },
|
||||
{ "mgba_use_bios", "Use BIOS file if found (requires restart); ON|OFF" },
|
||||
{ "mgba_skip_bios", "Skip BIOS intro (requires restart); OFF|ON" },
|
||||
{ "mgba_sgb_borders", "Use Super Game Boy borders (requires restart); ON|OFF" },
|
||||
|
|
Loading…
Reference in New Issue