summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--constants.asm8
-rw-r--r--extras/analyze_texts.py23
2 files changed, 28 insertions, 3 deletions
diff --git a/constants.asm b/constants.asm
index cc34ecbf..79ecdd94 100644
--- a/constants.asm
+++ b/constants.asm
@@ -79,6 +79,14 @@ TX_FAR: MACRO
db BANK(\1)
ENDM
+; text engine command $1
+TX_RAM: MACRO
+; prints text to screen
+; \1: RAM address to read from
+ db $1
+ dw \1
+ ENDM
+
; wram locations
W_AICOUNT EQU $CCDF ; number of times remaining that AI action can occur
diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py
index 36d80413..780bc08e 100644
--- a/extras/analyze_texts.py
+++ b/extras/analyze_texts.py
@@ -385,7 +385,7 @@ def find_missing_08s(all_texts):
def text_pretty_printer_at(start_address, label="SomeLabel"):
commands = parse_text_script(start_address, None, None)
- needs_to_begin_with_0 = False
+ needs_to_begin_with_0 = True #how should this be determined?
wanted_command = None
if needs_to_begin_with_0:
@@ -403,11 +403,28 @@ def text_pretty_printer_at(start_address, label="SomeLabel"):
first_line = True
for this_command in commands.keys():
- if not "lines" in commands[this_command].keys(): continue
+ if not "lines" in commands[this_command].keys():
+ command = commands[this_command]
+ if command["type"] == 0x1:
+ if first_line:
+ output = "\n"
+ output += label + ": ; " + hex(start_address) + "\n"
+ first_line = False
+ p1 = command["pointer"][0]
+ p2 = command["pointer"][1]
+
+ #remember to account for big endian -> little endian
+ output += spacing + "TX_RAM $" + hex(p2)[2:] + hex(p1)[2:] + "\n"
+
+ byte_count += 3
+
+ #everything else is for $0s, really
+ continue
lines = commands[this_command]["lines"]
#add the ending byte to the last line- always seems $57
- lines[len(lines.keys())-1].append(commands[1]["type"])
+ #this should already be in there, but it's not because of a bug in the text parser
+ lines[len(lines.keys())-1].append(commands[len(commands.keys())-1]["type"])
if first_line:
output = "\n"