mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
fix undo load state (#12062)
This commit is contained in:
parent
c43b0f53bf
commit
1e39de800c
@ -422,7 +422,6 @@ void autosave_unlock(void)
|
|||||||
bool content_undo_load_state(void)
|
bool content_undo_load_state(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
retro_ctx_serialize_info_t serial_info;
|
|
||||||
size_t temp_data_size;
|
size_t temp_data_size;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
unsigned num_blocks = 0;
|
unsigned num_blocks = 0;
|
||||||
@ -494,14 +493,11 @@ bool content_undo_load_state(void)
|
|||||||
temp_data_size = undo_load_buf.size;
|
temp_data_size = undo_load_buf.size;
|
||||||
memcpy(temp_data, undo_load_buf.data, undo_load_buf.size);
|
memcpy(temp_data, undo_load_buf.data, undo_load_buf.size);
|
||||||
|
|
||||||
serial_info.data_const = temp_data;
|
|
||||||
serial_info.size = temp_data_size;
|
|
||||||
|
|
||||||
/* Swap the current state with the backup state. This way, we can undo
|
/* Swap the current state with the backup state. This way, we can undo
|
||||||
what we're undoing */
|
what we're undoing */
|
||||||
content_save_state("RAM", false, false);
|
content_save_state("RAM", false, false);
|
||||||
|
|
||||||
ret = core_unserialize(&serial_info);
|
ret = content_deserialize_state(temp_data, temp_data_size);
|
||||||
|
|
||||||
/* Clean up the temporary copy */
|
/* Clean up the temporary copy */
|
||||||
free(temp_data);
|
free(temp_data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user