diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 2b0a6f5f86..e1e289a3a2 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -1821,8 +1821,6 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar) mem_size += 0xC000000; } - if (!ar) g_fxo->init(mem_size); - // Initialize process std::vector> loaded_modules; @@ -1874,6 +1872,17 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar) // Set ppc fixed allocations segment permission 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>(); + g_fxo->init(mem_size); + } + void init_fxo_for_exec(utils::serial* ar, bool full); 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(); } - if (Emu.init_mem_containers) - { - // Refer to sys_process_exit2 for explanation - Emu.init_mem_containers(mem_size); - } - else - { - g_fxo->init(mem_size); - } - ensure(g_fxo->get().take(primary_stacksize)); ppu->cmd_push({ppu_cmd::initialize, 0}); diff --git a/rpcs3/Emu/IdManager.h b/rpcs3/Emu/IdManager.h index d2fb0c3198..067f8f17f5 100644 --- a/rpcs3/Emu/IdManager.h +++ b/rpcs3/Emu/IdManager.h @@ -243,8 +243,8 @@ namespace id_manager vec.reserve(T::id_count); } - // Order it directly afterward the source type's position - static constexpr double savestate_init_pos = std::bit_cast(std::bit_cast(T::savestate_init_pos) + 1); + // Order it directly before the source type's position + static constexpr double savestate_init_pos = std::bit_cast(std::bit_cast(T::savestate_init_pos) - 1); id_map(utils::serial& ar) { diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 0d31454184..02f65b8fcc 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -88,7 +88,7 @@ static std::array s_serial_versions; 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(spu, 2, {1}) SERIALIZATION_VER(lv2_sync, 3, {1})