diff options
-rw-r--r-- | crystal.py | 2 | ||||
-rw-r--r-- | gbz80disasm.py | 13 |
2 files changed, 14 insertions, 1 deletions
@@ -2894,7 +2894,7 @@ pksv_crystal_more = { 0x99: ["hangup"], 0x9A: ["describedecoration", ["byte", SingleByteParam]], 0x9B: ["fruittree", ["tree_id", SingleByteParam]], - 0x9C: ["specialphonecall", ["call_id", SingleByteParam], ["wtf", SingleByteParam]], + 0x9C: ["specialphonecall", ["call_id", MultiByteParam]], 0x9D: ["checkphonecall"], 0x9E: ["verbosegiveitem", ["item", ItemLabelByte], ["quantity", DecimalParam]], 0x9F: ["verbosegiveitem2", ["item", ItemLabelByte]], diff --git a/gbz80disasm.py b/gbz80disasm.py index 07773fc..48739e0 100644 --- a/gbz80disasm.py +++ b/gbz80disasm.py @@ -722,6 +722,19 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000, debug = False): last_a_address = ord(rom[offset + 1]) opstr = opstr[:opstr.find("x")].lower() + insertion + opstr[opstr.find("x")+1:].lower() + + # because the $ff00+$ff syntax is silly + if opstr.count("$") > 0 and "+" in opstr: + first_orig = opstr.split("$")[1].split("+")[0] + first_num = "0x"+first_orig + first_val = int(first_num, 16) + second_orig = opstr.split("+$")[1].split("]")[0] + second_num = "0x"+second_orig + second_val = int(second_num, 16) + combined_val = "$" + hex(first_val + second_val)[2:] + replacetron = "[$"+first_orig+"+$"+second_orig+"]" + opstr = opstr.replace(replacetron, "["+combined_val+"]") + output += spacing + opstr if include_comment: output += " ; " + hex(offset) |