summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-02-27 20:02:51 -0600
committerBryan Bishop <kanzure@gmail.com>2013-02-27 20:02:51 -0600
commitd847dcd8f47d02bb2e0dea133414eb6fb0e54859 (patch)
tree04944bf1c15627ca286e0adc113fe998eca8026b
parentc7a67544b7c6036710b590599a35bb2c6e7a275f (diff)
make to_asm more configurable
original-commit-id: affcd587d69b18d84bcb473b28723613b755c846
-rw-r--r--crystal.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/crystal.py b/crystal.py
index 745f987..fa5ce80 100644
--- a/crystal.py
+++ b/crystal.py
@@ -2823,7 +2823,13 @@ pksv_crystal_more = {
0xA3: ["warpfacing", ["facing", SingleByteParam], ["map_group", MapGroupParam], ["map_id", MapIdParam], ["x", SingleByteParam], ["y", SingleByteParam]],
0xA4: ["storetext", ["pointer", PointerLabelBeforeBank], ["memory", SingleByteParam]],
0xA5: ["displaylocation", ["id", SingleByteParam]],
+ 0xA6: ["unknown0xa6"],
+ 0xA7: ["unknown0xa7"],
0xA8: ["unknown0xa8", ["unknown", SingleByteParam]],
+ 0xA9: ["unknown0xa9"],
+ 0xAA: ["unknown0xaa"],
+
+ # fix the scripts, then remove these.
0xB2: ["unknown0xb2", ["unknown", SingleByteParam]],
0xCC: ["unknown0xcc"],
}
@@ -6354,7 +6360,7 @@ incbin_lines = []
# storage for processed incbin lines
processed_incbins = {}
-def to_asm(some_object):
+def to_asm(some_object, use_asm_rules=False):
"""shows an object's asm with a label and an ending comment
showing the next byte address"""
if isinstance(some_object, int):
@@ -6370,6 +6376,9 @@ def to_asm(some_object):
asmr = asmr.replace("\n"+spacing+"\n", "\n\n"+spacing)
asmr = asmr.replace("\n\n"+spacing+spacing, "\n\n"+spacing)
asm += spacing + asmr
+ if use_asm_rules:
+ asm = asm.replace("\n" + spacing + "; ", "\n; ")
+ asm = asm.replace("\n" + spacing + ".asm_", "\n.asm_")
# show the address of the next byte below this
asm += "\n; " + hex(last_address)
return asm