From 765e846a9eac19008e00a15cf4dcf05653e614c9 Mon Sep 17 00:00:00 2001 From: yenatch Date: Mon, 2 Dec 2013 14:45:52 -0500 Subject: [PATCH] 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 --- pokemontools/crystal.py | 15 +++++++++++---- 1 file 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]],