rsx: zip and unzip rsx captures

This commit is contained in:
Megamouse 2023-11-09 22:31:55 +01:00
parent 66d01b688c
commit 840455b872
3 changed files with 25 additions and 4 deletions

View file

@ -38,6 +38,7 @@
#include "Utilities/StrUtil.h"
#include "../Crypto/unself.h"
#include "../Crypto/unzip.h"
#include "util/logs.hpp"
#include "util/serialization.hpp"
#include "savestate_utils.hpp"
@ -717,6 +718,16 @@ bool Emulator::BootRsxCapture(const std::string& path)
load.m_file_handler = make_uncompressed_serialization_file_handler(std::move(in_file));
load.set_reading_state();
if (fmt::to_lower(path).ends_with(".gz"))
{
load.data = unzip(load.data);
if (load.data.empty())
{
sys_log.error("Failed to unzip rsx capture file!");
return false;
}
}
load(*frame);
in_file.close();