diff options
author | Adrien Plazas <kekun.plazas@laposte.net> | 2020-12-12 13:30:02 +0100 |
---|---|---|
committer | twinaphex <libretro@gmail.com> | 2021-03-12 08:42:23 +0100 |
commit | a39082058e57ba13c18c4c7c6ad2760f4e307c5a (patch) | |
tree | 3eceef1beff3ad273048b1798b4c39bc68261a72 /libblastem.c | |
parent | d88b9a561c9ee6e536778712bc2a7dcf5e246a40 (diff) |
libretro: Use the default serialization size
This drops the cache which became invalid and instead return a large
enough serialization size, avoiding to serialize twice as it is slow.
Fixes https://github.com/libretro/blastem/issues/23.
Diffstat (limited to 'libblastem.c')
-rw-r--r-- | libblastem.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libblastem.c b/libblastem.c index fb5979a..6d3e906 100644 --- a/libblastem.c +++ b/libblastem.c @@ -184,14 +184,9 @@ RETRO_API void retro_run(void) * returned size is never allowed to be larger than a previous returned * value, to ensure that the frontend can allocate a save state buffer once. */ -static size_t serialize_size_cache; RETRO_API size_t retro_serialize_size(void) { - if (!serialize_size_cache) { - uint8_t *tmp = current_system->serialize(current_system, &serialize_size_cache); - free(tmp); - } - return serialize_size_cache; + return SERIALIZE_DEFAULT_SIZE; } /* Serializes internal state. If failed, or size is lower than @@ -227,7 +222,6 @@ RETRO_API void retro_cheat_set(unsigned index, bool enabled, const char *code) static system_type stype; RETRO_API bool retro_load_game(const struct retro_game_info *game) { - serialize_size_cache = 0; if (game->path) { media.dir = path_dirname(game->path); media.name = basename_no_extension(game->path); |