| | |
| | |
| | |
| |
|
| | #pragma once |
| |
|
| | #include <memory> |
| | #include <optional> |
| | #include <shared_mutex> |
| | #include <span> |
| | #include <vector> |
| | #include "common/common_types.h" |
| |
|
| | namespace Core { |
| | class System; |
| | struct TimingEventType; |
| | } |
| |
|
| | namespace CoreTiming { |
| | struct EventType; |
| | } |
| |
|
| | namespace Cheats { |
| |
|
| | class CheatBase; |
| |
|
| | class CheatEngine { |
| | public: |
| | explicit CheatEngine(Core::System& system); |
| | ~CheatEngine(); |
| |
|
| | |
| | void Connect(); |
| |
|
| | |
| | std::span<const std::shared_ptr<CheatBase>> GetCheats() const; |
| |
|
| | |
| | void AddCheat(std::shared_ptr<CheatBase>&& cheat); |
| |
|
| | |
| | void RemoveCheat(std::size_t index); |
| |
|
| | |
| | void UpdateCheat(std::size_t index, std::shared_ptr<CheatBase>&& new_cheat); |
| |
|
| | |
| | void LoadCheatFile(u64 title_id); |
| |
|
| | |
| | void SaveCheatFile(u64 title_id) const; |
| |
|
| | private: |
| | |
| | void RunCallback(std::uintptr_t user_data, s64 cycles_late); |
| |
|
| | private: |
| | Core::System& system; |
| | Core::TimingEventType* event; |
| | std::optional<u64> loaded_title_id; |
| | std::vector<std::shared_ptr<CheatBase>> cheats_list; |
| | mutable std::shared_mutex cheats_list_mutex; |
| | }; |
| | } |
| |
|