Use g_fxo for patch_engine

This commit is contained in:
Nekotekina 2019-08-25 14:55:37 +03:00
parent cfdd298693
commit 7a00b5f809
3 changed files with 10 additions and 10 deletions

View File

@ -982,12 +982,12 @@ std::shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, const std::stri
} }
// Apply the patch // Apply the patch
auto applied = fxm::check_unlocked<patch_engine>()->apply(hash, vm::g_base_addr); auto applied = g_fxo->get<patch_engine>()->apply(hash, vm::g_base_addr);
if (!Emu.GetTitleID().empty()) if (!Emu.GetTitleID().empty())
{ {
// Alternative patch // Alternative patch
applied += fxm::check_unlocked<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::g_base_addr); applied += g_fxo->get<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::g_base_addr);
} }
LOG_NOTICE(LOADER, "PRX library hash: %s (<- %u)", hash, applied); LOG_NOTICE(LOADER, "PRX library hash: %s (<- %u)", hash, applied);
@ -1135,12 +1135,12 @@ void ppu_load_exec(const ppu_exec_object& elf)
} }
// Apply the patch // Apply the patch
auto applied = fxm::check_unlocked<patch_engine>()->apply(hash, vm::g_base_addr); auto applied = g_fxo->get<patch_engine>()->apply(hash, vm::g_base_addr);
if (!Emu.GetTitleID().empty()) if (!Emu.GetTitleID().empty())
{ {
// Alternative patch // Alternative patch
applied += fxm::check_unlocked<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::g_base_addr); applied += g_fxo->get<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::g_base_addr);
} }
LOG_NOTICE(LOADER, "PPU executable hash: %s (<- %u)", hash, applied); LOG_NOTICE(LOADER, "PPU executable hash: %s (<- %u)", hash, applied);
@ -1606,12 +1606,12 @@ std::shared_ptr<lv2_overlay> ppu_load_overlay(const ppu_exec_object& elf, const
} }
// Apply the patch // Apply the patch
auto applied = fxm::check_unlocked<patch_engine>()->apply(hash, vm::g_base_addr); auto applied = g_fxo->get<patch_engine>()->apply(hash, vm::g_base_addr);
if (!Emu.GetTitleID().empty()) if (!Emu.GetTitleID().empty())
{ {
// Alternative patch // Alternative patch
applied += fxm::check_unlocked<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::g_base_addr); applied += g_fxo->get<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::g_base_addr);
} }
LOG_NOTICE(LOADER, "OVL executable hash: %s (<- %u)", hash, applied); LOG_NOTICE(LOADER, "OVL executable hash: %s (<- %u)", hash, applied);

View File

@ -130,12 +130,12 @@ void sys_spu_image::deploy(u32 loc, sys_spu_segment* segs, u32 nsegs)
} }
// Apply the patch // Apply the patch
auto applied = fxm::check_unlocked<patch_engine>()->apply(hash, vm::_ptr<u8>(loc)); auto applied = g_fxo->get<patch_engine>()->apply(hash, vm::_ptr<u8>(loc));
if (!Emu.GetTitleID().empty()) if (!Emu.GetTitleID().empty())
{ {
// Alternative patch // Alternative patch
applied += fxm::check_unlocked<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::_ptr<u8>(loc)); applied += g_fxo->get<patch_engine>()->apply(Emu.GetTitleID() + '-' + hash, vm::_ptr<u8>(loc));
} }
LOG_NOTICE(LOADER, "Loaded SPU image: %s (<- %u)%s", hash, applied, dump); LOG_NOTICE(LOADER, "Loaded SPU image: %s (<- %u)%s", hash, applied, dump);

View File

@ -365,7 +365,7 @@ void Emulator::Init()
#endif #endif
// Initialize patch engine // Initialize patch engine
fxm::make_always<patch_engine>()->append(fs::get_config_dir() + "/patch.yml"); g_fxo->init<patch_engine>()->append(fs::get_config_dir() + "/patch.yml");
// Initialize progress dialog server (TODO) // Initialize progress dialog server (TODO)
if (g_progr.exchange("") == nullptr) if (g_progr.exchange("") == nullptr)
@ -999,7 +999,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
} }
// Load patches from different locations // Load patches from different locations
fxm::check_unlocked<patch_engine>()->append(fs::get_config_dir() + "data/" + m_title_id + "/patch.yml"); g_fxo->get<patch_engine>()->append(fs::get_config_dir() + "data/" + m_title_id + "/patch.yml");
// Mount all devices // Mount all devices
const std::string emu_dir = GetEmuDir(); const std::string emu_dir = GetEmuDir();