summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-07-22 21:22:20 -0700
committeryenatch <yenatch@gmail.com>2014-07-22 21:22:20 -0700
commit9c7bce4ce7e25b6038277bb1dc31c716b18bb1c8 (patch)
tree1ee9873a8aa6a01e25434945f4e9ff0c4fcc6b83
parent007151b05a7c0e0e6f70f6f008aa1b6536992f78 (diff)
The checkflag command family uses engine flags.
-rw-r--r--pokemontools/crystal.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/pokemontools/crystal.py b/pokemontools/crystal.py
index 697960c..eee57e6 100644
--- a/pokemontools/crystal.py
+++ b/pokemontools/crystal.py
@@ -1454,14 +1454,15 @@ class DataByteWordMacro(Command):
event_flags = wram.read_constants(os.path.join(conf.path, 'constants/event_flags.asm'))
+engine_flags = wram.read_constants(os.path.join(conf.path, 'constants/engine_flags.asm'))
class EventFlagParam(MultiByteParam):
-
def to_asm(self):
- if self.parsed_number in event_flags.keys():
- return event_flags[self.parsed_number]
- return MultiByteParam.to_asm(self)
+ return event_flags.get(self.parsed_number) or MultiByteParam.to_asm(self)
+class EngineFlagParam(MultiByteParam):
+ def to_asm(self):
+ return engine_flags.get(self.parsed_number) or MultiByteParam.to_asm(self)
class MovementCommand(Command):
@@ -2276,9 +2277,9 @@ pksv_crystal_more = {
0x31: ["checkevent", ["event_flag", EventFlagParam]],
0x32: ["clearevent", ["event_flag", EventFlagParam]],
0x33: ["setevent", ["event_flag", EventFlagParam]],
- 0x34: ["checkflag", ["event_flag", EventFlagParam]],
- 0x35: ["clearflag", ["event_flag", EventFlagParam]],
- 0x36: ["setflag", ["event_flag", EventFlagParam]],
+ 0x34: ["checkflag", ["engine_flag", EngineFlagParam]],
+ 0x35: ["clearflag", ["engine_flag", EngineFlagParam]],
+ 0x36: ["setflag", ["engine_flag", EngineFlagParam]],
0x37: ["wildon"],
0x38: ["wildoff"],
0x39: ["xycompare", ["pointer", MultiByteParam]],