Make cheats struct more versatile

This commit is contained in:
offtkp 2023-10-24 16:52:08 +03:00
parent d4a84c337e
commit 7e7d4f7f16
4 changed files with 82 additions and 5 deletions

View file

@ -12,17 +12,22 @@ class Memory;
class Cheats {
public:
enum class CheatType {
None,
ActionReplay, // CTRPF cheats
// TODO: Other cheat devices and standards?
};
struct Cheat {
bool enabled;
CheatType type;
std::vector<u32> instructions;
};
Cheats(Memory& mem, HIDService& hid);
void addCheat(const Cheat& cheat);
uint32_t addCheat(const Cheat& cheat);
void removeCheat(uint32_t id);
void enableCheat(uint32_t id);
void disableCheat(uint32_t id);
void reset();
void run();

View file

@ -115,6 +115,7 @@ class Emulator {
void deinitGraphicsContext() { gpu.deinitGraphicsContext(); }
EmulatorConfig& getConfig() { return config; }
Cheats& getCheats() { return cheats; }
ServiceManager& getServiceManager() { return kernel.getServiceManager(); }
RendererType getRendererType() const { return config.rendererType; }
Renderer* getRenderer() { return gpu.getRenderer(); }