mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
Savestates: Fix memory containers initialization (invalidates old savestates)
This commit is contained in:
parent
fddb6a31a7
commit
72c14994f0
3 changed files with 14 additions and 15 deletions
|
@ -1821,8 +1821,6 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar)
|
||||||
mem_size += 0xC000000;
|
mem_size += 0xC000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ar) g_fxo->init<lv2_memory_container>(mem_size);
|
|
||||||
|
|
||||||
// Initialize process
|
// Initialize process
|
||||||
std::vector<std::shared_ptr<lv2_prx>> loaded_modules;
|
std::vector<std::shared_ptr<lv2_prx>> loaded_modules;
|
||||||
|
|
||||||
|
@ -1874,6 +1872,17 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar)
|
||||||
// Set ppc fixed allocations segment permission
|
// Set ppc fixed allocations segment permission
|
||||||
g_ps3_process_info.ppc_seg = ppc_seg;
|
g_ps3_process_info.ppc_seg = ppc_seg;
|
||||||
|
|
||||||
|
if (Emu.init_mem_containers)
|
||||||
|
{
|
||||||
|
// Refer to sys_process_exit2 for explanation
|
||||||
|
Emu.init_mem_containers(mem_size);
|
||||||
|
}
|
||||||
|
else if (!ar)
|
||||||
|
{
|
||||||
|
g_fxo->init<id_manager::id_map<lv2_memory_container>>();
|
||||||
|
g_fxo->init<lv2_memory_container>(mem_size);
|
||||||
|
}
|
||||||
|
|
||||||
void init_fxo_for_exec(utils::serial* ar, bool full);
|
void init_fxo_for_exec(utils::serial* ar, bool full);
|
||||||
init_fxo_for_exec(ar, false);
|
init_fxo_for_exec(ar, false);
|
||||||
|
|
||||||
|
@ -1995,16 +2004,6 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar)
|
||||||
ppu->gpr[1] -= Emu.data.size();
|
ppu->gpr[1] -= Emu.data.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Emu.init_mem_containers)
|
|
||||||
{
|
|
||||||
// Refer to sys_process_exit2 for explanation
|
|
||||||
Emu.init_mem_containers(mem_size);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_fxo->init<lv2_memory_container>(mem_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
ensure(g_fxo->get<lv2_memory_container>().take(primary_stacksize));
|
ensure(g_fxo->get<lv2_memory_container>().take(primary_stacksize));
|
||||||
|
|
||||||
ppu->cmd_push({ppu_cmd::initialize, 0});
|
ppu->cmd_push({ppu_cmd::initialize, 0});
|
||||||
|
|
|
@ -243,8 +243,8 @@ namespace id_manager
|
||||||
vec.reserve(T::id_count);
|
vec.reserve(T::id_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order it directly afterward the source type's position
|
// Order it directly before the source type's position
|
||||||
static constexpr double savestate_init_pos = std::bit_cast<double>(std::bit_cast<u64>(T::savestate_init_pos) + 1);
|
static constexpr double savestate_init_pos = std::bit_cast<double>(std::bit_cast<u64>(T::savestate_init_pos) - 1);
|
||||||
|
|
||||||
id_map(utils::serial& ar)
|
id_map(utils::serial& ar)
|
||||||
{
|
{
|
||||||
|
|
|
@ -88,7 +88,7 @@ static std::array<serial_ver_t, 18> s_serial_versions;
|
||||||
return ::s_serial_versions[identifier].current_version;\
|
return ::s_serial_versions[identifier].current_version;\
|
||||||
}
|
}
|
||||||
|
|
||||||
SERIALIZATION_VER(global_version, 0, {9}) // For stuff not listed here
|
SERIALIZATION_VER(global_version, 0, {10}) // For stuff not listed here
|
||||||
SERIALIZATION_VER(ppu, 1, {1})
|
SERIALIZATION_VER(ppu, 1, {1})
|
||||||
SERIALIZATION_VER(spu, 2, {1})
|
SERIALIZATION_VER(spu, 2, {1})
|
||||||
SERIALIZATION_VER(lv2_sync, 3, {1})
|
SERIALIZATION_VER(lv2_sync, 3, {1})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue