mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(RARCH_CONSOLE) Compile in SRAM Autosave option in by default
for RARCH_CONSOLE now
This commit is contained in:
parent
460533aa53
commit
0faa3fbbde
@ -1893,7 +1893,7 @@ void menu_populate_entries(void *data, unsigned menu_type)
|
||||
rgui_list_push(rgui->selection_buf, "GPU Screenshots", RGUI_SETTINGS_GPU_SCREENSHOT, 0);
|
||||
#endif
|
||||
rgui_list_push(rgui->selection_buf, "Config Save On Exit", RGUI_SETTINGS_CONFIG_SAVE_ON_EXIT, 0);
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
rgui_list_push(rgui->selection_buf, "SRAM Autosave", RGUI_SETTINGS_SRAM_AUTOSAVE, 0);
|
||||
#endif
|
||||
rgui_list_push(rgui->selection_buf, "Show Framerate", RGUI_SETTINGS_DEBUG_TEXT, 0);
|
||||
|
@ -498,10 +498,8 @@ THREAD
|
||||
#include "../thread.c"
|
||||
#include "../gfx/thread_wrapper.c"
|
||||
#include "../audio/thread_wrapper.c"
|
||||
#ifndef RARCH_CONSOLE
|
||||
#include "../autosave.c"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*============================================================
|
||||
|
14
retroarch.c
14
retroarch.c
@ -1675,7 +1675,7 @@ static void init_libretro_cbs(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
void rarch_init_autosave(void)
|
||||
{
|
||||
int ram_types[2] = {-1, -1};
|
||||
@ -2467,7 +2467,7 @@ void rarch_disk_control_append_image(const char *path)
|
||||
msg_queue_clear(g_extern.msg_queue);
|
||||
msg_queue_push(g_extern.msg_queue, msg, 0, 180);
|
||||
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
rarch_deinit_autosave();
|
||||
#endif
|
||||
|
||||
@ -2478,7 +2478,7 @@ void rarch_disk_control_append_image(const char *path)
|
||||
set_paths(path);
|
||||
fill_pathnames();
|
||||
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
rarch_init_autosave();
|
||||
#endif
|
||||
|
||||
@ -3003,7 +3003,7 @@ int rarch_main_init(int argc, char *argv[])
|
||||
if (!g_extern.use_sram)
|
||||
RARCH_LOG("SRAM will not be saved.\n");
|
||||
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
if (g_extern.use_sram)
|
||||
rarch_init_autosave();
|
||||
#endif
|
||||
@ -3127,7 +3127,7 @@ bool rarch_main_iterate(void)
|
||||
do_state_checks();
|
||||
|
||||
// Run libretro for one frame.
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
lock_autosave();
|
||||
#endif
|
||||
|
||||
@ -3155,7 +3155,7 @@ bool rarch_main_iterate(void)
|
||||
netplay_post_frame(g_extern.netplay);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
unlock_autosave();
|
||||
#endif
|
||||
|
||||
@ -3171,7 +3171,7 @@ void rarch_main_deinit(void)
|
||||
deinit_command();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
|
||||
#if defined(HAVE_THREADS)
|
||||
if (g_extern.use_sram)
|
||||
rarch_deinit_autosave();
|
||||
#endif
|
||||
|
11
thread.c
11
thread.c
@ -313,7 +313,6 @@ int scond_broadcast(scond_t *cond)
|
||||
return pthread_cond_broadcast(&cond->cond);
|
||||
}
|
||||
|
||||
#ifndef RARCH_CONSOLE
|
||||
bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
|
||||
{
|
||||
struct timespec now;
|
||||
@ -326,20 +325,28 @@ bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
|
||||
mach_port_deallocate(mach_task_self(), cclock);
|
||||
now.tv_sec = mts.tv_sec;
|
||||
now.tv_nsec = mts.tv_nsec;
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
sys_time_sec_t s;
|
||||
sys_time_nsec_t n;
|
||||
sys_time_get_current_time(&s, &n);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, &now);
|
||||
#endif
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
now.tv_sec = s;
|
||||
now.tv_nsec = n;
|
||||
#else
|
||||
now.tv_sec += timeout_us / 1000000LL;
|
||||
now.tv_nsec += timeout_us * 1000LL;
|
||||
|
||||
now.tv_sec += now.tv_nsec / 1000000000LL;
|
||||
now.tv_nsec = now.tv_nsec % 1000000000LL;
|
||||
#endif
|
||||
|
||||
int ret = pthread_cond_timedwait(&cond->cond, &lock->lock, &now);
|
||||
return ret == 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void scond_signal(scond_t *cond)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user