diff --git a/retroarch.c b/retroarch.c index 9d34073b4d..38cf41ebce 100644 --- a/retroarch.c +++ b/retroarch.c @@ -920,51 +920,6 @@ static void init_cheats(void) /* TODO/FIXME - add some stuff here. */ } -static void init_rewind(void) -{ - void *state = NULL; - driver_t *driver = driver_get_ptr(); - settings_t *settings = config_get_ptr(); - global_t *global = global_get_ptr(); - - (void)driver; - -#ifdef HAVE_NETPLAY - if (driver->netplay_data) - return; -#endif - - if (!settings->rewind_enable || global->rewind.state) - return; - - if (global->system.audio_callback.callback) - { - RARCH_ERR(RETRO_LOG_REWIND_INIT_FAILED_THREADED_AUDIO); - return; - } - - global->rewind.size = pretro_serialize_size(); - - if (!global->rewind.size) - { - RARCH_ERR(RETRO_LOG_REWIND_INIT_FAILED_NO_SAVESTATES); - return; - } - - RARCH_LOG(RETRO_MSG_REWIND_INIT "%u MB\n", - (unsigned)(settings->rewind_buffer_size / 1000000)); - - global->rewind.state = state_manager_new(global->rewind.size, - settings->rewind_buffer_size); - - if (!global->rewind.state) - RARCH_WARN(RETRO_LOG_REWIND_INIT_FAILED); - - state_manager_push_where(global->rewind.state, &state); - pretro_serialize(state, global->rewind.size); - state_manager_push_do(global->rewind.state); -} - static void init_movie(void) { settings_t *settings = config_get_ptr(); diff --git a/rewind.c b/rewind.c index 05d3cdfbde..668e3830a5 100644 --- a/rewind.c +++ b/rewind.c @@ -22,6 +22,8 @@ #include #include #include +#include "intl/intl.h" +#include "dynamic.h" #ifndef UINT16_MAX #define UINT16_MAX 0xffff @@ -522,3 +524,48 @@ void state_manager_capacity(state_manager_t *state, if (full) *full = remaining <= state->maxcompsize * 2; } + +void init_rewind(void) +{ + void *state = NULL; + driver_t *driver = driver_get_ptr(); + settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); + + (void)driver; + +#ifdef HAVE_NETPLAY + if (driver->netplay_data) + return; +#endif + + if (!settings->rewind_enable || global->rewind.state) + return; + + if (global->system.audio_callback.callback) + { + RARCH_ERR(RETRO_LOG_REWIND_INIT_FAILED_THREADED_AUDIO); + return; + } + + global->rewind.size = pretro_serialize_size(); + + if (!global->rewind.size) + { + RARCH_ERR(RETRO_LOG_REWIND_INIT_FAILED_NO_SAVESTATES); + return; + } + + RARCH_LOG(RETRO_MSG_REWIND_INIT "%u MB\n", + (unsigned)(settings->rewind_buffer_size / 1000000)); + + global->rewind.state = state_manager_new(global->rewind.size, + settings->rewind_buffer_size); + + if (!global->rewind.state) + RARCH_WARN(RETRO_LOG_REWIND_INIT_FAILED); + + state_manager_push_where(global->rewind.state, &state); + pretro_serialize(state, global->rewind.size); + state_manager_push_do(global->rewind.state); +} diff --git a/rewind.h b/rewind.h index 3e999272b6..08052ee6f2 100644 --- a/rewind.h +++ b/rewind.h @@ -40,6 +40,8 @@ void state_manager_push_do(state_manager_t *state); void state_manager_capacity(state_manager_t *state, unsigned int *entries, size_t *bytes, bool *full); +void init_rewind(void); + #ifdef __cplusplus } #endif