mirror of
https://github.com/libretro/bsnes-libretro-cplusplus98.git
synced 2025-04-14 08:00:25 +00:00
35 lines
649 B
C++
35 lines
649 B
C++
struct CheatCode {
|
|
bool enabled;
|
|
array<unsigned> addr;
|
|
array<uint8> data;
|
|
|
|
bool operator=(string);
|
|
CheatCode();
|
|
};
|
|
|
|
class Cheat : public linear_vector<CheatCode> {
|
|
public:
|
|
struct Type { enum e { ProActionReplay, GameGenie } i; };
|
|
uint8 *override;
|
|
|
|
bool enabled() const;
|
|
void enable(bool);
|
|
void synchronize();
|
|
uint8 read(unsigned) const;
|
|
void init();
|
|
|
|
Cheat();
|
|
~Cheat();
|
|
|
|
static bool decode(const char*, unsigned&, uint8&, Type&);
|
|
static bool encode(string&, unsigned, uint8, Type);
|
|
|
|
private:
|
|
bool system_enabled;
|
|
bool code_enabled;
|
|
bool cheat_enabled;
|
|
unsigned mirror(unsigned) const;
|
|
};
|
|
|
|
extern Cheat cheat;
|