diff options
author | yenatch <yenatch@gmail.com> | 2013-12-02 14:45:52 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-12-02 14:45:52 -0500 |
commit | 765e846a9eac19008e00a15cf4dcf05653e614c9 (patch) | |
tree | 8d03d185cd3a8e90da1e57223ba1f8a6316c45dc | |
parent | 79630cd43b8e814afa517b473344d065217c851a (diff) |
crystal: fix storetext and rework PointerLabel{Before,After}Bank
- storetext only takes one param
- the logic for PointerLabel*Bank was actually in preprocessor.py. theyve also been changed to take a single label
-rw-r--r-- | pokemontools/crystal.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/pokemontools/crystal.py b/pokemontools/crystal.py index eb88b6b..3385945 100644 --- a/pokemontools/crystal.py +++ b/pokemontools/crystal.py @@ -945,12 +945,19 @@ class PointerLabelParam(MultiByteParam): class PointerLabelBeforeBank(PointerLabelParam): bank = True # bank appears first, see calculate_pointer_from_bytes_at - size = 3 - byte_type = "dw" + byte_type = 'db' + + @staticmethod + def from_asm(value): + return 'BANK({0})\n\tdw {0}'.format(value) class PointerLabelAfterBank(PointerLabelParam): bank = "reverse" # bank appears last, see calculate_pointer_from_bytes_at - size = 3 + byte_type = 'dw' + + @staticmethod + def from_asm(value): + return '{0}\n\tdb BANK({0})'.format(value) class ScriptPointerLabelParam(PointerLabelParam): pass @@ -2358,7 +2365,7 @@ pksv_crystal_more = { 0xA1: ["halloffame"], 0xA2: ["credits"], 0xA3: ["warpfacing", ["facing", SingleByteParam], ["map_group", MapGroupParam], ["map_id", MapIdParam], ["x", SingleByteParam], ["y", SingleByteParam]], - 0xA4: ["storetext", ["pointer", PointerLabelBeforeBank], ["memory", SingleByteParam]], + 0xA4: ["storetext", ["memory", SingleByteParam]], 0xA5: ["displaylocation", ["id", SingleByteParam], ["memory", SingleByteParam]], 0xA6: ["trainerclassname", ["id", SingleByteParam]], 0xA7: ["name", ["type", SingleByteParam], ["id", SingleByteParam]], |