summaryrefslogtreecommitdiff
path: root/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-05-22 11:50:25 -0500
committerBryan Bishop <kanzure@gmail.com>2012-05-22 11:50:25 -0500
commit5055302451b376f9250ab61258de6f1eb6d53738 (patch)
tree56ab3f82b95d3486818e4bf8c1b06dd86f317e30 /crystal.py
parentdfe7d7ce34a06e769dae462b6fcf5477c5322d02 (diff)
use EncodedText for stringtotext params
original-commit-id: 256795769263d5fc392e1ca4b56736832a4a9d64
Diffstat (limited to 'crystal.py')
-rw-r--r--crystal.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/crystal.py b/crystal.py
index 38b8c15..14b6f57 100644
--- a/crystal.py
+++ b/crystal.py
@@ -1756,7 +1756,20 @@ class RawTextPointerLabelParam(PointerLabelParam):
#self.text = TextScript(address, map_group=self.map_group, map_id=self.map_id, debug=self.debug)
self.text = parse_text_engine_script_at(address, map_group=self.map_group, map_id=self.map_id, debug=self.debug)
- string_to_text_texts.append(self.text)
+ def get_dependencies(self, recompute=False, global_dependencies=set()):
+ global_dependencies.add(self.text)
+ return [self.text]
+
+class EncodedTextLabelParam(PointerLabelParam):
+ def parse(self):
+ PointerLabelParam.parse(self)
+
+ address = calculate_pointer_from_bytes_at(self.address, bank=False)
+ self.parsed_address = address
+ self.text = EncodedText(address, map_group=self.map_group, map_id=self.map_id, debug=self.debug)
+
+ if isinstance(self.text, EncodedText):
+ string_to_text_texts.append(self.text)
def get_dependencies(self, recompute=False, global_dependencies=set()):
global_dependencies.add(self.text)
@@ -2769,7 +2782,7 @@ pksv_crystal_more = {
0x41: ["itemtotext", ["item", ItemLabelByte], ["memory", SingleByteParam]],
0x42: ["mapnametotext", ["memory", SingleByteParam]], #not pksv
0x43: ["trainertotext", ["trainer_id", TrainerGroupParam], ["trainer_group", TrainerIdParam], ["memory", SingleByteParam]],
- 0x44: ["stringtotext", ["text_pointer", RawTextPointerLabelParam], ["memory", SingleByteParam]],
+ 0x44: ["stringtotext", ["text_pointer", EncodedTextLabelParam], ["memory", SingleByteParam]],
0x45: ["itemnotify"],
0x46: ["pocketisfull"],
0x47: ["loadfont"],