mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-16 01:56:42 +13:00
TX_RAM for text engine command $1 in pretty_text
hg-commit-id: e4f95976fef8
This commit is contained in:
parent
5f7bb0da72
commit
f01ad092a5
|
|
@ -79,6 +79,14 @@ TX_FAR: MACRO
|
||||||
db BANK(\1)
|
db BANK(\1)
|
||||||
ENDM
|
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
|
; wram locations
|
||||||
W_AICOUNT EQU $CCDF ; number of times remaining that AI action can occur
|
W_AICOUNT EQU $CCDF ; number of times remaining that AI action can occur
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,7 @@ def find_missing_08s(all_texts):
|
||||||
|
|
||||||
def text_pretty_printer_at(start_address, label="SomeLabel"):
|
def text_pretty_printer_at(start_address, label="SomeLabel"):
|
||||||
commands = parse_text_script(start_address, None, None)
|
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
|
wanted_command = None
|
||||||
if needs_to_begin_with_0:
|
if needs_to_begin_with_0:
|
||||||
|
|
@ -403,11 +403,28 @@ def text_pretty_printer_at(start_address, label="SomeLabel"):
|
||||||
|
|
||||||
first_line = True
|
first_line = True
|
||||||
for this_command in commands.keys():
|
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"]
|
lines = commands[this_command]["lines"]
|
||||||
|
|
||||||
#add the ending byte to the last line- always seems $57
|
#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:
|
if first_line:
|
||||||
output = "\n"
|
output = "\n"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue