Add CheatEngine and support for Gateway cheats (#4406)

* Add CheatEngine; Add support for Gateway cheats; Add Cheat UI

* fix a potential crash on some systems

* fix substr with negative length

* Add Joker to the NonOp comp handling

* Fixup JokerOp

* minor fixup in patchop; add todo for nested loops

* Add comment for PadState member variable in HID

* fix: stol to stoul in parsing cheat file

* fix misplaced parsing of values; fix patchop code

* add missing break

* Make read_func and write_func a template parameter
This commit is contained in:
Ben 2018-11-17 02:01:10 +01:00 committed by James Rowe
parent 560df843b1
commit b90ff739a0
23 changed files with 1052 additions and 1 deletions

View file

@ -12,6 +12,7 @@
#include "core/arm/dynarmic/arm_dynarmic.h"
#endif
#include "core/arm/dyncom/arm_dyncom.h"
#include "core/cheats/cheats.h"
#include "core/core.h"
#include "core/core_timing.h"
#include "core/gdbstub/gdbstub.h"
@ -143,6 +144,7 @@ System::ResultStatus System::Load(EmuWindow& emu_window, const std::string& file
}
}
Memory::SetCurrentPageTable(&kernel->GetCurrentProcess()->vm_manager.page_table);
cheat_engine = std::make_unique<Cheats::CheatEngine>(*this);
status = ResultStatus::Success;
m_emu_window = &emu_window;
m_filepath = filepath;
@ -248,6 +250,14 @@ const Timing& System::CoreTiming() const {
return *timing;
}
Cheats::CheatEngine& System::CheatEngine() {
return *cheat_engine;
}
const Cheats::CheatEngine& System::CheatEngine() const {
return *cheat_engine;
}
void System::RegisterSoftwareKeyboard(std::shared_ptr<Frontend::SoftwareKeyboard> swkbd) {
registered_swkbd = std::move(swkbd);
}
@ -271,6 +281,7 @@ void System::Shutdown() {
#ifdef ENABLE_SCRIPTING
rpc_server.reset();
#endif
cheat_engine.reset();
service_manager.reset();
dsp_core.reset();
cpu_core.reset();