mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Check for updated values, log options.
This commit is contained in:
parent
418a830665
commit
e6f7b709c4
@ -110,6 +110,15 @@ static bool parse_variable(core_option_manager_t *opt, size_t index, const struc
|
||||
}
|
||||
|
||||
free(value);
|
||||
|
||||
RARCH_LOG("Core option:\n");
|
||||
RARCH_LOG("\tDescription: %s\n", option->desc);
|
||||
RARCH_LOG("\tKey: %s\n", option->key);
|
||||
RARCH_LOG("\tCurrent value: %s\n", core_option_get_val(opt, index));
|
||||
RARCH_LOG("\tPossible values:\n");
|
||||
for (size_t i = 0; i < option->vals->size; i++)
|
||||
RARCH_LOG("\t\t%s\n", option->vals->elems[i].data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -206,11 +206,29 @@ static void render_audio(void)
|
||||
phase %= 100;
|
||||
}
|
||||
|
||||
static void check_variables(void)
|
||||
{
|
||||
struct retro_variable var = {0};
|
||||
var.key = "test_opt0";
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
fprintf(stderr, "Key -> Val: %s -> %s.\n", var.key, var.value);
|
||||
var.key = "test_opt1";
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
fprintf(stderr, "Key -> Val: %s -> %s.\n", var.key, var.value);
|
||||
var.key = "test_opt2";
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
fprintf(stderr, "Key -> Val: %s -> %s.\n", var.key, var.value);
|
||||
}
|
||||
|
||||
void retro_run(void)
|
||||
{
|
||||
update_input();
|
||||
render_checkered();
|
||||
render_audio();
|
||||
|
||||
bool updated = false;
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
|
||||
check_variables();
|
||||
}
|
||||
|
||||
static void keyboard_cb(bool down, unsigned keycode,
|
||||
@ -242,16 +260,7 @@ bool retro_load_game(const struct retro_game_info *info)
|
||||
struct retro_keyboard_callback cb = { keyboard_cb };
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK, &cb);
|
||||
|
||||
struct retro_variable var = {0};
|
||||
var.key = "test_opt0";
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
fprintf(stderr, "Key -> Val: %s -> %s.\n", var.key, var.value);
|
||||
var.key = "test_opt1";
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
fprintf(stderr, "Key -> Val: %s -> %s.\n", var.key, var.value);
|
||||
var.key = "test_opt2";
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
fprintf(stderr, "Key -> Val: %s -> %s.\n", var.key, var.value);
|
||||
check_variables();
|
||||
|
||||
(void)info;
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user