From 2c0eb777569962842f86ded6e1024ee0b2b3b30b Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 30 Sep 2016 14:51:05 -0400 Subject: [PATCH] core_[un]serialize waits for initialization quirk. --- core_impl.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/core_impl.c b/core_impl.c index e0197842f5..0f58f60633 100644 --- a/core_impl.c +++ b/core_impl.c @@ -282,6 +282,8 @@ bool core_unserialize(retro_ctx_serialize_info_t *info) { if (!info) return false; + if (core_serialization_quirks_v & RETRO_SERIALIZATION_QUIRK_INITIALIZING) + return false; if (!core.retro_unserialize(info->data_const, info->size)) return false; @@ -292,20 +294,12 @@ bool core_unserialize(retro_ctx_serialize_info_t *info) return true; } -uint32_t core_serialization_quirks(void) -{ - return core_serialization_quirks_v; -} - -void core_set_serialization_quirks(uint32_t quirks) -{ - core_serialization_quirks_v = quirks; -} - bool core_serialize(retro_ctx_serialize_info_t *info) { if (!info) return false; + if (core_serialization_quirks_v & RETRO_SERIALIZATION_QUIRK_INITIALIZING) + return false; if (!core.retro_serialize(info->data, info->size)) return false; return true; @@ -319,6 +313,16 @@ bool core_serialize_size(retro_ctx_size_info_t *info) return true; } +uint32_t core_serialization_quirks(void) +{ + return core_serialization_quirks_v; +} + +void core_set_serialization_quirks(uint32_t quirks) +{ + core_serialization_quirks_v = quirks; +} + bool core_frame(retro_ctx_frame_info_t *info) { if (!info || !retro_ctx.frame_cb)