shithub: pokered

Download patch

ref: 8626486876a828d8798dec21970254005f11b52a
parent: 238a5e62aee049540f94677c663a87dfde7fea1f
author: Bryan Bishop <kanzure@gmail.com>
date: Thu Jan 5 12:10:21 EST 2012

start using EVENT_DISP in object data output

hg-commit-id: bbc9b24dd8cc


--- a/extras/pretty_map_headers.py
+++ b/extras/pretty_map_headers.py
@@ -483,12 +483,15 @@
         output += spacing + "; warp-to\n"
         output += "\n"
 
-        #TODO: use EVENT_DISP per sawakita
         for warp_to_id in object["warp_tos"]:
             warp_to = object["warp_tos"][warp_to_id]
-    
-            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"
+            map_width = map["x"]
+            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"
+            #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"