diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-01-13 01:05:10 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-01-13 01:05:10 -0600 |
commit | 9d4f5a459f79357dcb0046560b067b4a1fb73cef (patch) | |
tree | 7753514c6bf149c0137fa19f27c99ca02b53a81c /extras/gbz80disasm.py | |
parent | 91104ff20c46dd8d299eb95e4f6c33ae55a5f92f (diff) |
a very slow tool to find script pointers for each map
hg-commit-id: a61a85fd7577
Diffstat (limited to 'extras/gbz80disasm.py')
-rw-r--r-- | extras/gbz80disasm.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/extras/gbz80disasm.py b/extras/gbz80disasm.py index 496e46f1..6dc512a5 100644 --- a/extras/gbz80disasm.py +++ b/extras/gbz80disasm.py @@ -582,6 +582,9 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): #ad = end_address #a, oa = current_byte_number + last_hl_address = None #for when we're scanning the main map script + last_a_address = None + rom = extract_maps.rom offset = original_offset current_byte_number = 0 #start from the beginning @@ -686,6 +689,8 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): insertion = line_label2.lower() include_comment = True + elif current_byte == 0x3e: + last_a_address = ord(rom[offset + 1]) opstr = opstr[:opstr.find("x")].lower() + insertion + opstr[opstr.find("x")+1:].lower() output += spacing + opstr @@ -728,6 +733,9 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): current_byte_number += 1 offset += 1 + if current_byte == 0x21: + last_hl_address = byte1 + (byte2 << 8) + #duck out if this is jp $24d7 if current_byte == 0xc3 or current_byte in relative_unconditional_jumps: #if number == 0x24d7: #jp @@ -766,7 +774,7 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): #add the offset of the final location output += "; " + hex(offset) - return (output, offset) + return (output, offset, last_hl_address, last_a_address) def has_outstanding_labels(byte_labels): """ |