From 3fc837c6eb2d087f303b60f155ce00b0e8f3998f Mon Sep 17 00:00:00 2001 From: neonloop Date: Mon, 30 Jan 2023 15:56:43 +0000 Subject: Adds override for deferring load state by number of frames Fixes instant play for fake-08 and pcsx_rearmmed with bios intro --- patches/fake-08/0001-fix-resume-state.patch | 81 ----------------------------- 1 file changed, 81 deletions(-) delete mode 100644 patches/fake-08/0001-fix-resume-state.patch (limited to 'patches') diff --git a/patches/fake-08/0001-fix-resume-state.patch b/patches/fake-08/0001-fix-resume-state.patch deleted file mode 100644 index b3d73bc..0000000 --- a/patches/fake-08/0001-fix-resume-state.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff --git a/platform/libretro/libretro.cpp b/platform/libretro/libretro.cpp -index 927ea8d4b8d1658a1d7521fe7e9abcbdede0ba5f..63a43f3f065344cdf45e0b10e5c9c089736695f2 100644 ---- a/platform/libretro/libretro.cpp -+++ b/platform/libretro/libretro.cpp -@@ -82,6 +82,46 @@ EXPORT void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) { audio_ - EXPORT void retro_set_input_poll(retro_input_poll_t cb) { input_poll_cb = cb; } - EXPORT void retro_set_input_state(retro_input_state_t cb) { input_state_cb = cb; } - -+ -+static int frames = 0; -+static int defer_frames = 2; -+static void* deferred_data = NULL; -+static size_t deferred_size = 0; -+ -+static void free_deferred_data(void) { -+ if (deferred_size) { -+ if (log_cb) log_cb(RETRO_LOG_INFO, "Freed deferred save state.\n"); -+ free(deferred_data); -+ deferred_data = NULL; -+ deferred_size = 0; -+ } -+} -+ -+static void defer_unserialize(const void *data, size_t size) { -+ free_deferred_data(); -+ -+ if (data==NULL || size<=0) return; -+ -+ if (log_cb) log_cb(RETRO_LOG_INFO, "Deferred save state load.\n"); -+ -+ deferred_data = malloc(size); -+ memcpy(deferred_data, data, size); -+ deferred_size = size; -+} -+static void update_deferred(void) { -+ frames += 1; -+ -+ if (framesCloseCart(); - _host->oneTimeCleanup(); -@@ -205,6 +247,8 @@ int flip = 0; - - EXPORT void retro_run() - { -+ if (framesgetTargetFps() == 60 || frame % 2 == 0) - { -@@ -396,6 +440,11 @@ EXPORT bool retro_serialize(void *data, size_t size) - - EXPORT bool retro_unserialize(const void *data, size_t size) - { -+ if (frames