From a65cd9e5f9304c47833198442aa138b542be6c6e Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Thu, 19 Oct 2023 19:56:43 +0200 Subject: [PATCH] savestate: fix retroarch savestate compatibility A new RA header must be skipped in standalone --- core/serialize.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/serialize.h b/core/serialize.h index f364630be..3d2f14264 100644 --- a/core/serialize.h +++ b/core/serialize.h @@ -97,6 +97,12 @@ public: Deserializer(const void *data, size_t limit, bool rollback = false) : SerializeBase(limit, rollback), data((const u8 *)data) { + if (!memcmp(data, "RASTATE\001", 8)) + { + // RetroArch savestate: a 16-byte header is now added here because why not? + this->data += 16; + this->limit -= 16; + } deserialize(_version); if (_version < V9_LIBRETRO || (_version > V13_LIBRETRO && _version < V8)) throw Exception("Unsupported version");