mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Savestates: Fix avconf serialization
This commit is contained in:
parent
91a54c11eb
commit
3856b77e15
3 changed files with 11 additions and 8 deletions
|
@ -723,19 +723,22 @@ namespace rsx
|
||||||
|
|
||||||
avconf::avconf(utils::serial& ar)
|
avconf::avconf(utils::serial& ar)
|
||||||
{
|
{
|
||||||
ar(*this);
|
save(ar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void avconf::save(utils::serial& ar)
|
void avconf::save(utils::serial& ar)
|
||||||
{
|
{
|
||||||
[[maybe_unused]] const s32 version = GET_OR_USE_SERIALIZATION_VERSION(ar.is_writing(), rsx);
|
[[maybe_unused]] const s32 version = GET_OR_USE_SERIALIZATION_VERSION(ar.is_writing(), rsx);
|
||||||
|
|
||||||
ar(stereo_mode, format, aspect, resolution_id, scanline_pitch, gamma, resolution_x, resolution_y, state);
|
if (!ar.is_writing() && version < 3)
|
||||||
|
|
||||||
if (ar.is_writing() || version >= 3)
|
|
||||||
{
|
{
|
||||||
ar(scan_mode);
|
// Be compatible with previous bitwise serialization
|
||||||
|
ar(std::span<u8>(reinterpret_cast<u8*>(this), ::offset32(&avconf::scan_mode)));
|
||||||
|
ar.pos += utils::align<usz>(::offset32(&avconf::scan_mode), alignof(avconf)) - ::offset32(&avconf::scan_mode);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ar(stereo_mode, format, aspect, resolution_id, scanline_pitch, gamma, resolution_x, resolution_y, state, scan_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void thread::capture_frame(const std::string &name)
|
void thread::capture_frame(const std::string &name)
|
||||||
|
|
|
@ -215,7 +215,7 @@ std::string get_savestate_file(std::string_view title_id, std::string_view boot_
|
||||||
if (abs_id == -1 && rel_id == -1)
|
if (abs_id == -1 && rel_id == -1)
|
||||||
{
|
{
|
||||||
// Return directory
|
// Return directory
|
||||||
return fs::get_cache_dir() + "/savestates/" + title + "/";
|
return fs::get_cache_dir() + "savestates/" + title + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
ensure(rel_id < 0 || abs_id >= 0, "Unimplemented!");
|
ensure(rel_id < 0 || abs_id >= 0, "Unimplemented!");
|
||||||
|
@ -263,7 +263,7 @@ bool boot_last_savestate(bool testing)
|
||||||
{
|
{
|
||||||
if (!g_cfg.savestate.suspend_emu && !Emu.GetTitleID().empty() && (Emu.IsRunning() || Emu.GetStatus() == system_state::paused))
|
if (!g_cfg.savestate.suspend_emu && !Emu.GetTitleID().empty() && (Emu.IsRunning() || Emu.GetStatus() == system_state::paused))
|
||||||
{
|
{
|
||||||
const std::string save_dir = fs::get_cache_dir() + "/savestates/" + Emu.GetTitleID() + '/';
|
const std::string save_dir = fs::get_cache_dir() + "savestates/" + Emu.GetTitleID() + '/';
|
||||||
|
|
||||||
std::string savestate_path;
|
std::string savestate_path;
|
||||||
s64 mtime = smin;
|
s64 mtime = smin;
|
||||||
|
|
|
@ -618,7 +618,7 @@ void main_window::BootSavestate()
|
||||||
stopped = true;
|
stopped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString file_path = QFileDialog::getOpenFileName(this, tr("Select Savestate To Boot"), qstr(fs::get_cache_dir() + "/savestates/"), tr(
|
const QString file_path = QFileDialog::getOpenFileName(this, tr("Select Savestate To Boot"), qstr(fs::get_cache_dir() + "savestates/"), tr(
|
||||||
"Savestate files (*.SAVESTAT *.SAVESTAT.gz);;"
|
"Savestate files (*.SAVESTAT *.SAVESTAT.gz);;"
|
||||||
"All files (*.*)"),
|
"All files (*.*)"),
|
||||||
Q_NULLPTR, QFileDialog::DontResolveSymlinks);
|
Q_NULLPTR, QFileDialog::DontResolveSymlinks);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue