all repos — mgba @ eddd3851bcb05c553524956c08c5e58c3dc8fff9

mGBA Game Boy Advance Emulator

Libretro: Allow choosing the Game Boy model
Douglas Christman DouglasChristman@gmail.com
Sat, 24 Mar 2018 19:09:27 +0800
commit

eddd3851bcb05c553524956c08c5e58c3dc8fff9

parent

ea2159d159f2ddb5514b9137a116eb74a2ed872f

1 files changed, 22 insertions(+), 0 deletions(-)

jump to
M src/platform/libretro/libretro.csrc/platform/libretro/libretro.c

@@ -63,6 +63,27 @@ .volume = 0x100,

}; 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 @@

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" },