Libretro: Add frameskip option

This commit is contained in:
Vicki Pfau 2018-01-12 20:52:15 -08:00
parent 6f5ec7d5e4
commit cee6569bde
2 changed files with 20 additions and 5 deletions

View File

@ -54,6 +54,7 @@ Misc:
- GB MBC: Remove erroneous bank 0 wrapping - GB MBC: Remove erroneous bank 0 wrapping
- GBA Cheats: Allow multiple ROM patches in the same slot - GBA Cheats: Allow multiple ROM patches in the same slot
- GB: Skip BIOS option now works - GB: Skip BIOS option now works
- Libretro: Add frameskip option
0.6.1: (2017-10-01) 0.6.1: (2017-10-01)
Bugfixes: Bugfixes:

View File

@ -88,6 +88,13 @@ static void _reloadSettings(void) {
} }
} }
var.key = "mgba_frameskip";
var.value = 0;
if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
opts.frameskip = strtol(var.value, NULL, 10);
}
mCoreConfigLoadDefaults(&core->config, &opts); mCoreConfigLoadDefaults(&core->config, &opts);
mCoreLoadConfig(core); mCoreLoadConfig(core);
} }
@ -105,6 +112,7 @@ void retro_set_environment(retro_environment_t env) {
{ "mgba_use_bios", "Use BIOS file if found (requires restart); ON|OFF" }, { "mgba_use_bios", "Use BIOS file if found (requires restart); ON|OFF" },
{ "mgba_skip_bios", "Skip BIOS intro (requires restart); OFF|ON" }, { "mgba_skip_bios", "Skip BIOS intro (requires restart); OFF|ON" },
{ "mgba_idle_optimization", "Idle loop removal; Remove Known|Detect and Remove|Don't Remove" }, { "mgba_idle_optimization", "Idle loop removal; Remove Known|Detect and Remove|Don't Remove" },
{ "mgba_frameskip", "Frameskip; 0|1|2|3|4|5|6|7|8|9|10" },
{ 0, 0 } { 0, 0 }
}; };
@ -222,16 +230,22 @@ void retro_run(void) {
uint16_t keys; uint16_t keys;
inputPollCallback(); inputPollCallback();
bool updated = false;
if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) {
struct retro_variable var = { struct retro_variable var = {
.key = "mgba_allow_opposing_directions", .key = "mgba_allow_opposing_directions",
.value = 0 .value = 0
}; };
bool updated = false;
if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) {
if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
((struct GBA*) core->board)->allowOpposingDirections = strcmp(var.value, "yes") == 0; ((struct GBA*) core->board)->allowOpposingDirections = strcmp(var.value, "yes") == 0;
} }
var.key = "mgba_frameskip";
var.value = 0;
if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
mCoreConfigSetUIntValue(&core->config, "frameskip", strtol(var.value, NULL, 10));
mCoreLoadConfig(core);
}
} }
keys = 0; keys = 0;