From 0560a8a4fe951a4f5a4a649d5c5d111cf3ce2e7b Mon Sep 17 00:00:00 2001 From: Sky Date: Sun, 23 Oct 2022 02:34:15 -0700 Subject: [PATCH] =?UTF-8?q?=E3=80=90WEB=E3=80=91Flush=20emscripten=5Ffs=20?= =?UTF-8?q?when=20saving=20save=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.c b/src/main.c index 8b3a0eec8..0f5f58b24 100644 --- a/src/main.c +++ b/src/main.c @@ -231,6 +231,7 @@ void se_load_rom_overlay(bool visible); void sb_draw_onscreen_controller(sb_emu_state_t*state, int controller_h, int controller_y_pad); void se_reset_save_states(); void se_set_new_controller(se_controller_state_t* cont, int index); +static void se_emscripten_flush_fs(); static uint32_t se_save_best_effort_state(se_core_state_t* state); static bool se_load_best_effort_state(se_core_state_t* state,uint8_t *save_state_data, uint32_t size, uint32_t bess_offset); static size_t se_get_core_size(); @@ -501,6 +502,7 @@ void se_save_state_to_disk(se_save_state_t* save_state, const char* filename){ snprintf(png_path,SB_FILE_PATH_SIZE,"%s.png",filename); stbi_write_png(png_path, save_state->screenshot_width*scale, save_state->screenshot_height*scale, 4, imdata, 0); free(imdata); + se_emscripten_flush_fs(); } bool se_bess_state_restore(uint8_t*state_data, size_t data_size, const se_emu_id emu_id, se_save_state_t* state){ state->state = core;