summaryrefslogtreecommitdiff
path: root/vba.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-03-03 21:42:35 -0600
committerBryan Bishop <kanzure@gmail.com>2013-03-03 21:42:35 -0600
commitbb839a1f9e83e6855c27ff61f782cc8bb41a14d4 (patch)
tree6c4732603f67282c0d2d0ae24bbf65df1a79b185 /vba.py
parentef2813c399a13553df16542d863a50623c7c6746 (diff)
vba - basic cheating infrastructure
original-commit-id: a1ed7e76583127562c73bf12766ba2958451b9dc
Diffstat (limited to 'vba.py')
-rw-r--r--vba.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/vba.py b/vba.py
index 8ed0d7b..c1ff353 100644
--- a/vba.py
+++ b/vba.py
@@ -564,6 +564,66 @@ def call(bank, address):
else:
registers["pc"] = address
+class cheats:
+ """
+ Helpers to manage the cheating infrastructure.
+
+ import vba; vba.load_rom(); vba.cheats.add_gameshark("0100CFCF", "text speedup 1"); vba.cheats.add_gameshark("0101CCCF", "text speedup 2"); vba.go()
+ """
+
+ @staticmethod
+ def enable(id):
+ """
+ void gbCheatEnable(int i)
+ """
+ Gb.cheatEnable(id)
+
+ @staticmethod
+ def disable(id):
+ """
+ void gbCheatDisable(int i)
+ """
+ Gb.cheatDisable(id)
+
+ @staticmethod
+ def load_file(filename):
+ """
+ Loads a .clt file. By default each cheat is disabled.
+ """
+ Gb.loadCheatsFromFile(filename)
+
+ @staticmethod
+ def remove_all():
+ """
+ Removes all cheats from memory.
+
+ void gbCheatRemoveAll()
+ """
+ Gb.cheatRemoveAll()
+
+ @staticmethod
+ def remove_cheat(id):
+ """
+ Removes a specific cheat from memory by id.
+
+ void gbCheatRemove(int i)
+ """
+ Gb.cheatRemove(id)
+
+ @staticmethod
+ def add_gamegenie(code, description=""):
+ """
+ void gbAddGgCheat(const char *code, const char *desc)
+ """
+ Gb.cheatAddGamegenie(code, description)
+
+ @staticmethod
+ def add_gameshark(code, description=""):
+ """
+ gbAddGsCheat(const char *code, const char *desc)
+ """
+ Gb.cheatAddGameshark(code, description)
+
class crystal:
"""
Just a simple namespace to store a bunch of functions for Pokémon Crystal.