mirror of
https://github.com/libretro/gambatte-libretro.git
synced 2024-11-23 07:49:48 +00:00
Start implementing retro_cheat_set/retro_cheat_reset
This commit is contained in:
parent
e83511445b
commit
459c2ffba2
@ -113,6 +113,8 @@ public:
|
||||
*/
|
||||
void setGameShark(const std::string &codes);
|
||||
|
||||
void clearCheats();
|
||||
|
||||
private:
|
||||
struct Priv;
|
||||
Priv *const p_;
|
||||
|
@ -188,8 +188,19 @@ bool retro_unserialize(const void *data, size_t size)
|
||||
return true;
|
||||
}
|
||||
|
||||
void retro_cheat_reset() {}
|
||||
void retro_cheat_set(unsigned, bool, const char *) {}
|
||||
void retro_cheat_reset()
|
||||
{
|
||||
gb.clearCheats();
|
||||
}
|
||||
|
||||
void retro_cheat_set(unsigned index, bool enabled, const char *code)
|
||||
{
|
||||
std::string s = code;
|
||||
if (s.find("-") != std::string::npos)
|
||||
gb.setGameGenie(code);
|
||||
else
|
||||
gb.setGameShark(code);
|
||||
}
|
||||
|
||||
|
||||
static std::string basename(std::string filename)
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
|
||||
void setGameGenie(const std::string &codes) { memory.setGameGenie(codes); }
|
||||
void setGameShark(const std::string &codes) { memory.setGameShark(codes); }
|
||||
void clearCheats() { memory.clearCheats(); }
|
||||
|
||||
void display_setColorCorrection(bool enable) { memory.display_setColorCorrection(enable); }
|
||||
video_pixel_t display_gbcToRgb32(const unsigned bgr15) { return memory.display_gbcToRgb32(bgr15); }
|
||||
|
@ -146,6 +146,7 @@ public:
|
||||
|
||||
void setDmgPaletteColor(unsigned palNum, unsigned colorNum, unsigned long rgb32);
|
||||
void setGameGenie(const std::string &codes) { cart.setGameGenie(codes); }
|
||||
void clearCheats() { cart.clearCheats(); }
|
||||
void setGameShark(const std::string &codes) { interrupter.setGameShark(codes); }
|
||||
|
||||
void display_setColorCorrection(bool enable) { display.setColorCorrection(enable); }
|
||||
|
@ -139,5 +139,9 @@ void GB::setGameShark(const std::string &codes) {
|
||||
p_->cpu.setGameShark(codes);
|
||||
}
|
||||
|
||||
void GB::clearCheats() {
|
||||
p_->cpu.clearCheats();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -418,6 +418,10 @@ void Cartridge::applyGameGenie(const std::string &code) {
|
||||
}
|
||||
}
|
||||
|
||||
void Cartridge::clearCheats() {
|
||||
ggUndoList.clear();
|
||||
}
|
||||
|
||||
void Cartridge::setGameGenie(const std::string &codes) {
|
||||
//if (loaded()) {
|
||||
for (std::vector<AddrData>::reverse_iterator it = ggUndoList.rbegin(), end = ggUndoList.rend(); it != end; ++it) {
|
||||
|
@ -103,6 +103,7 @@ public:
|
||||
void setSaveDir(const std::string &dir);
|
||||
bool loadROM(const void *romdata, unsigned romsize, bool forceDmg, bool multicartCompat);
|
||||
void setGameGenie(const std::string &codes);
|
||||
void clearCheats();
|
||||
|
||||
void *savedata_ptr()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user