Simple patch engine

This commit is contained in:
Nekotekina 2017-03-29 02:54:05 +03:00
parent 77e88741bc
commit 78b9c64f67
5 changed files with 160 additions and 0 deletions

View file

@ -2,6 +2,7 @@
#include "Utilities/Config.h"
#include "Utilities/AutoPause.h"
#include "Utilities/event.h"
#include "Utilities/bin_patch.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
@ -99,6 +100,9 @@ void Emulator::Init()
fs::create_dir(dev_hdd1 + "game/");
fs::create_path(dev_hdd1);
fs::create_path(dev_usb);
// Initialize patch engine
fxm::make_always<patch_engine>()->append(fs::get_config_dir() + "/patch.yml");
}
void Emulator::SetPath(const std::string& path, const std::string& elf_path)
@ -215,6 +219,10 @@ void Emulator::Load()
LOG_NOTICE(LOADER, "Used configuration:\n%s\n", cfg::root.to_string());
// Load patches from different locations
fxm::check_unlocked<patch_engine>()->append(fs::get_config_dir() + "data/" + m_title_id + "/patch.yml");
fxm::check_unlocked<patch_engine>()->append(m_cache_path + "/patch.yml");
// Mount all devices
const std::string emu_dir_ = g_cfg_vfs_emulator_dir;
const std::string emu_dir = emu_dir_.empty() ? fs::get_config_dir() : emu_dir_;