diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-01-05 19:51:32 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-01-05 19:51:32 -0600 |
commit | 813959be7f22cd003ccf1c38037ce49f04d411ec (patch) | |
tree | 69ba85235911c5bcd335c4f8597b31463b171a84 /extras/pretty_map_headers.py | |
parent | 1cd1d213d53914cf637de5b6d585598c1254878f (diff) |
use sprite constants in pretty printer
hg-commit-id: cd88256deb01
Diffstat (limited to 'extras/pretty_map_headers.py')
-rw-r--r-- | extras/pretty_map_headers.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/extras/pretty_map_headers.py b/extras/pretty_map_headers.py index 527f8948..eee3c5d1 100644 --- a/extras/pretty_map_headers.py +++ b/extras/pretty_map_headers.py @@ -4,6 +4,7 @@ #purpose: dump asm for each map header import json import extract_maps +import sprite_helper import random import string @@ -415,6 +416,12 @@ def make_object_label_name(name): name = map_name_cleaner(name, None) return name.replace("_h", "") + "Object" +def make_text_label(map_name, id): + """using standard object labels + for instance, PalletTownText3""" + label = map_name_cleaner(map_name, None)[:-2] + "Text" + str(id) + return label + def object_data_pretty_printer(map_id): map = extract_maps.map_headers[map_id] output = "" @@ -451,7 +458,7 @@ def object_data_pretty_printer(map_id): x = sign["x"] text_id = sign["text_id"] - output += spacing + "db $" + hex(int(y))[2:] + ", $" + hex(int(x))[2:] + ", $" + hex(int(text_id))[2:] + "\n" + output += spacing + "db $" + hex(int(y))[2:] + ", $" + hex(int(x))[2:] + ", $" + hex(int(text_id))[2:] + " ; " + make_text_label(map["name"], text_id) + "\n" output += "\n" output += spacing + "db $" + hex(int(object["number_of_things"]))[2:] + " ; people\n" @@ -475,13 +482,12 @@ def object_data_pretty_printer(map_id): movement2 = hex(int(thing["movement2"]))[2:] text_id = hex(int(thing["original_text_string_number"]))[2:] - output += spacing + "db $" + picture_number + ", $" + y + " + 4, $" + x + " + 4, $" + movement1 + ", $" + movement2 + ", $" + text_id + ending + output += spacing + "db " + sprite_helper.sprites[thing["picture_number"]] + ", $" + y + " + 4, $" + x + " + 4, $" + movement1 + ", $" + movement2 + ", $" + text_id + ending output += "\n" if object["number_of_warps"] > 0: output += spacing + "; warp-to\n" - output += "\n" for warp_to_id in object["warp_tos"]: warp_to = object["warp_tos"][warp_to_id] @@ -489,11 +495,13 @@ def object_data_pretty_printer(map_id): warp_to_y = hex(int(warp_to["y"]))[2:] warp_to_x = hex(int(warp_to["x"]))[2:] - output += spacing + "EVENT_DISP $" + map_width[2:] + ", $" + warp_to_y + ", $" + warp_to_x + "\n" + previous_location = map_constants[object["warps"][warp_to_id]["warp_to_map_id"]] + comment = previous_location + + output += spacing + "EVENT_DISP $" + map_width[2:] + ", $" + warp_to_y + ", $" + warp_to_x + " ; " + comment + "\n" #output += spacing + "dw $" + hex(int(warp_to["event_displacement"][1]))[2:] + hex(int(warp_to["event_displacement"][0]))[2:] + "\n" #output += spacing + "db $" + hex(int(warp_to["y"]))[2:] + ", $" + hex(int(warp_to["x"]))[2:] + "\n" - - output += "\n" + #output += "\n" output += "\n" |