From df059c585f45f4b4ae14295560ba8ce91e8eb4d5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 8 Sep 2018 02:19:05 +0200 Subject: [PATCH] Implement RETRO_ENVIRONMENT_GET_FASTFORWARDING --- dynamic.c | 9 +++++++++ libretro-common/include/libretro.h | 6 ++++++ retroarch.c | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dynamic.c b/dynamic.c index 230ec324c2..3a70ddf884 100644 --- a/dynamic.c +++ b/dynamic.c @@ -1851,6 +1851,15 @@ bool rarch_environment_cb(unsigned cmd, void *data) } } break; + + case RETRO_ENVIRONMENT_GET_FASTFORWARDING: + { + extern bool runloop_fastmotion; + RARCH_LOG("RETRO_ENVIRONMENT_GET_FASTFORWARDING %d\n", runloop_fastmotion); + *(bool *)data = runloop_fastmotion; + } + break; + default: RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd); diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index 826283b3fa..78e67a0781 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -1189,6 +1189,12 @@ struct retro_led_interface * Returns a MIDI interface that can be used for raw data I/O. */ +#define RETRO_ENVIRONMENT_GET_FASTFORWARDING (49 | RETRO_ENVIRONMENT_EXPERIMENTAL) + /* bool * -- + * Boolean value that indicates whether or not the frontend is in + * fastforwarding mode. + */ + /* Retrieves the current state of the MIDI input. * Returns true if it's enabled, false otherwise. */ typedef bool (RETRO_CALLCONV *retro_midi_input_enabled_t)(void); diff --git a/retroarch.c b/retroarch.c index 42c8fa24b6..6b49f0e41c 100644 --- a/retroarch.c +++ b/retroarch.c @@ -238,7 +238,7 @@ static bool runloop_paused = false; static bool runloop_idle = false; static bool runloop_exec = false; static bool runloop_slowmotion = false; -static bool runloop_fastmotion = false; +bool runloop_fastmotion = false; static bool runloop_shutdown_initiated = false; static bool runloop_core_shutdown_initiated = false; static bool runloop_perfcnt_enable = false;