diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-01-13 14:31:22 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-01-13 14:31:22 -0600 |
commit | 71ebf0b95e9d5f31c8021910f70d0b8b9b79043c (patch) | |
tree | e0df1aa7acbd26a93b5979c465b38692e72a488c /extras/gbz80disasm.py | |
parent | bc3bf29219a5f3d89faa0ba82c3cb4a7d76c38c1 (diff) |
code to insert main scripts and subscripts
hg-commit-id: 807e8743e682
Diffstat (limited to 'extras/gbz80disasm.py')
-rw-r--r-- | extras/gbz80disasm.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/extras/gbz80disasm.py b/extras/gbz80disasm.py index 6dc512a5..2150611c 100644 --- a/extras/gbz80disasm.py +++ b/extras/gbz80disasm.py @@ -584,6 +584,7 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): last_hl_address = None #for when we're scanning the main map script last_a_address = None + used_3d97 = False rom = extract_maps.rom offset = original_offset @@ -734,10 +735,14 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): offset += 1 if current_byte == 0x21: - last_hl_address = byte1 + (byte2 << 8) + last_hl_address = byte1 + (byte2 << 8) + if current_byte == 0xcd: + if number == 0x3d97: used_3d97 = True #duck out if this is jp $24d7 if current_byte == 0xc3 or current_byte in relative_unconditional_jumps: + if current_byte == 0xc3: + if number == 0x3d97: used_3d97 = True #if number == 0x24d7: #jp if not has_outstanding_labels(byte_labels): keep_reading = False @@ -774,7 +779,7 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): #add the offset of the final location output += "; " + hex(offset) - return (output, offset, last_hl_address, last_a_address) + return (output, offset, last_hl_address, last_a_address, used_3d97) def has_outstanding_labels(byte_labels): """ |