mirror of
https://github.com/devinacker/bsnes-plus.git
synced 2025-04-02 10:52:46 -04:00
note: mirroring detection for cheats doesn't work for two addresses in the same 64kb bank i.e. the lowest 16 bits of both addresses must still be the same
34 lines
679 B
C++
34 lines
679 B
C++
struct CheatCode {
|
|
bool enabled;
|
|
array<unsigned> addr;
|
|
array<uint8> data;
|
|
|
|
bool operator=(string);
|
|
CheatCode();
|
|
};
|
|
|
|
class Cheat : public linear_vector<CheatCode> {
|
|
public:
|
|
enum class Type : unsigned { ProActionReplay, GameGenie };
|
|
|
|
bool enabled() const;
|
|
void enable(bool);
|
|
void synchronize();
|
|
bool read(unsigned, uint8&, Bus&) const;
|
|
|
|
inline bool active() const;
|
|
inline bool exists(uint16 addr) const;
|
|
|
|
Cheat();
|
|
|
|
static bool decode(const char*, unsigned&, uint8&, Type&);
|
|
static bool encode(string&, unsigned, uint8, Type);
|
|
|
|
private:
|
|
uint8 bitmask[0x2000];
|
|
bool system_enabled;
|
|
bool code_enabled;
|
|
bool cheat_enabled;
|
|
};
|
|
|
|
extern Cheat cheat;
|