Savestates: Fix config_event_entry compatibility

This commit is contained in:
Eladash 2023-08-24 19:59:24 +03:00 committed by Elad Ashkenazi
parent 5fde96d563
commit 68c70dd1b9
3 changed files with 28 additions and 4 deletions

View File

@ -53,14 +53,19 @@ void fmt_class_string<CellPadFilterError>::format(std::string& out, u64 arg)
});
}
extern void sys_io_serialize(utils::serial& ar);
pad_info::pad_info(utils::serial& ar)
: max_connect(ar)
, port_setting(ar)
{
sys_io_serialize(ar);
}
void pad_info::save(utils::serial& ar)
{
USING_SERIALIZATION_VERSION(sys_io);
ar(max_connect, port_setting);
}

View File

@ -23,16 +23,30 @@ struct libio_sys_config
~libio_sys_config() noexcept
{
}
void save_or_load(utils::serial& ar)
{
ar(init_ctr, ppu_id, queue_id);
}
};
extern void sys_io_serialize(utils::serial& ar)
{
// Do not assign a serialization tag for now, call it from cellPad serialization
g_fxo->get<libio_sys_config>().save_or_load(ar);
}
extern void cellPad_NotifyStateChange(u32 index, u32 state);
void config_event_entry(ppu_thread& ppu)
{
auto& cfg = g_fxo->get<libio_sys_config>();
// Ensure awake
ppu.check_state();
if (!ppu.loaded_from_savestate)
{
// Ensure awake
ppu.check_state();
}
while (!sys_event_queue_receive(ppu, cfg.queue_id, vm::null, 0))
{

View File

@ -18,7 +18,7 @@ struct serial_ver_t
std::set<s32> compatible_versions;
};
static std::array<serial_ver_t, 23> s_serial_versions;
static std::array<serial_ver_t, 26> s_serial_versions;
#define SERIALIZATION_VER(name, identifier, ...) \
\
@ -35,7 +35,7 @@ static std::array<serial_ver_t, 23> s_serial_versions;
return ::s_serial_versions[identifier].current_version;\
}
SERIALIZATION_VER(global_version, 0, 13) // For stuff not listed here
SERIALIZATION_VER(global_version, 0, 14) // For stuff not listed here
SERIALIZATION_VER(ppu, 1, 1)
SERIALIZATION_VER(spu, 2, 1)
SERIALIZATION_VER(lv2_sync, 3, 1)
@ -73,6 +73,11 @@ SERIALIZATION_VER(cellGcm, 19, 1)
SERIALIZATION_VER(sysPrxForUser, 20, 1)
SERIALIZATION_VER(cellSaveData, 21, 1)
SERIALIZATION_VER(cellAudioOut, 22, 1)
SERIALIZATION_VER(sys_io, 23, 1)
// Misc versions for HLE/LLE not included so main version would not invalidated
SERIALIZATION_VER(LLE, 24, 1)
SERIALIZATION_VER(HLE, 25, 1)
std::vector<std::pair<u16, u16>> get_savestate_versioning_data(const fs::file& file)
{