diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-01-05 20:57:41 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-01-05 20:57:41 -0600 |
commit | cfe485a1e6c6aafdcadbd47be9098c37ca88f167 (patch) | |
tree | c6b7002e9993a65edb9caa4063bd9dcf98d94fc7 /extras | |
parent | 813959be7f22cd003ccf1c38037ce49f04d411ec (diff) |
insert object asm
hg-commit-id: 9974e529c8d6
Diffstat (limited to 'extras')
-rw-r--r-- | extras/extract_maps.py | 2 | ||||
-rw-r--r-- | extras/pretty_map_headers.py | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/extras/extract_maps.py b/extras/extract_maps.py index 1c4dc5d9..d1efb16a 100644 --- a/extras/extract_maps.py +++ b/extras/extract_maps.py @@ -532,7 +532,7 @@ def get_object_data(address): def compute_object_data_size(object): size = 4 - size += 6 * (object["number_of_things"]) + size += 6 * (int(object["number_of_things"])) trainer_count = 0 item_count = 0 diff --git a/extras/pretty_map_headers.py b/extras/pretty_map_headers.py index eee3c5d1..0a483b9b 100644 --- a/extras/pretty_map_headers.py +++ b/extras/pretty_map_headers.py @@ -444,7 +444,10 @@ def object_data_pretty_printer(map_id): warp_to_point = warp["warp_to_point"] warp_to_map_id = warp["warp_to_map_id"] - warp_to_map_constant = map_constants[warp_to_map_id] + try: + warp_to_map_constant = map_constants[warp_to_map_id] + except Exception, exc: + warp_to_map_constant = "$" + hex(warp_to_map_id)[2:] output += spacing + "db $" + hex(int(y))[2:] + ", $" + hex(int(x))[2:] + ", $" + hex(int(warp_to_point))[2:] + ", " + warp_to_map_constant + "\n" @@ -495,10 +498,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:] - previous_location = map_constants[object["warps"][warp_to_id]["warp_to_map_id"]] - comment = previous_location + try: + previous_location = map_constants[object["warps"][warp_to_id]["warp_to_map_id"]] + comment = " ; " + previous_location + except Exception, exc: + comment = "" - output += spacing + "EVENT_DISP $" + map_width[2:] + ", $" + warp_to_y + ", $" + warp_to_x + " ; " + comment + "\n" + 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" |