diff --git a/core/archive/rzip.h b/core/archive/rzip.h index f59773c04..2743535eb 100644 --- a/core/archive/rzip.h +++ b/core/archive/rzip.h @@ -32,6 +32,7 @@ public: size_t Size() const { return size; } size_t Read(void *data, size_t length); size_t Write(const void *data, size_t length); + FILE *rawFile() const { return file; } private: FILE *file = nullptr; diff --git a/core/nullDC.cpp b/core/nullDC.cpp index 94ca3cbcf..72b89d8f5 100644 --- a/core/nullDC.cpp +++ b/core/nullDC.cpp @@ -160,6 +160,15 @@ void dc_loadstate(int index) if (zipFile.Open(filename, false)) { total_size = (u32)zipFile.Size(); + if (index == -1 && config::GGPOEnable) + { + f = zipFile.rawFile(); + long pos = std::ftell(f); + MD5Sum().add(f) + .getDigest(settings.network.md5.savestate); + std::fseek(f, pos, SEEK_SET); + f = nullptr; + } } else {