all repos — mgba @ 1ac5726d8a2b4ff8f63d0d0e80445b92726fcf42

mGBA Game Boy Advance Emulator

Libretro: Clean up config item style
Jeffrey Pfau jeffrey@endrift.com
Fri, 08 Jan 2016 22:04:32 -0800
commit

1ac5726d8a2b4ff8f63d0d0e80445b92726fcf42

parent

78b761cf017c6ee039810f29316b3736eee07fd4

1 files changed, 15 insertions(+), 21 deletions(-)

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

@@ -18,12 +18,6 @@

#define SAMPLES 1024 #define RUMBLE_PWM 35 -#define SOLAR_SENSOR_LEVEL "mgba_solar_sensor_level" -#define ALLOW_OPPOSING_DIRECTIONS "mgba_allow_opposing_directions" -#define USE_BIOS "mgba_use_bios" -#define SKIP_BIOS "mgba_skip_bios" -#define IDLE_OPTIMIZATION "mgba_idle_optimization" - static retro_environment_t environCallback; static retro_video_refresh_t videoCallback; static retro_audio_sample_batch_t audioCallback;

@@ -61,26 +55,26 @@ };

struct retro_variable var; - var.key = USE_BIOS; + var.key = "mgba_use_bios"; var.value = 0; if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - opts.useBios = strcmp(var.value, "yes") == 0; + opts.useBios = strcmp(var.value, "ON") == 0; } - var.key = SKIP_BIOS; + var.key = "mgba_skip_bios"; var.value = 0; if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - opts.skipBios = strcmp(var.value, "yes") == 0; + opts.skipBios = strcmp(var.value, "ON") == 0; } - var.key = IDLE_OPTIMIZATION; + var.key = "mgba_idle_optimization"; var.value = 0; if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - if (strcmp(var.value, "don't remove") == 0) { + if (strcmp(var.value, "Don't Remove") == 0) { opts.idleOptimization = IDLE_LOOP_IGNORE; - } else if (strcmp(var.value, "remove known") == 0) { + } else if (strcmp(var.value, "Remove Known") == 0) { opts.idleOptimization = IDLE_LOOP_REMOVE; - } else if (strcmp(var.value, "detect and remove") == 0) { + } else if (strcmp(var.value, "Detect and Remove") == 0) { opts.idleOptimization = IDLE_LOOP_DETECT; } }

@@ -96,11 +90,11 @@ void retro_set_environment(retro_environment_t env) {

environCallback = env; struct retro_variable vars[] = { - { SOLAR_SENSOR_LEVEL, "Solar sensor level; 0|1|2|3|4|5|6|7|8|9|10" }, - { ALLOW_OPPOSING_DIRECTIONS, "Allow opposing directional input; no|yes" }, - { USE_BIOS, "Use BIOS file if found; yes|no" }, - { SKIP_BIOS, "Skip BIOS intro; no|yes" }, - { IDLE_OPTIMIZATION, "Idle loop removal; remove known|detect and remove|don't remove" }, + { "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_use_bios", "Use BIOS file if found; ON|OFF" }, + { "mgba_skip_bios", "Skip BIOS intro; OFF|ON" }, + { "mgba_idle_optimization", "Idle loop removal; Remove Known|Detect and Remove|Don't Remove" }, { 0, 0 } };

@@ -252,7 +246,7 @@ uint16_t keys;

inputPollCallback(); struct retro_variable var = { - .key = ALLOW_OPPOSING_DIRECTIONS, + .key = "mgba_allow_opposing_directions", .value = 0 };

@@ -507,7 +501,7 @@

static void _updateLux(struct GBALuminanceSource* lux) { UNUSED(lux); struct retro_variable var = { - .key = SOLAR_SENSOR_LEVEL, + .key = "mgba_solar_sensor_level", .value = 0 };