diff options
Diffstat (limited to 'extras/gbz80disasm.py')
-rw-r--r-- | extras/gbz80disasm.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/extras/gbz80disasm.py b/extras/gbz80disasm.py index c07fad51..1f9f7c6c 100644 --- a/extras/gbz80disasm.py +++ b/extras/gbz80disasm.py @@ -546,6 +546,7 @@ end_08_scripts_with = [ ###0xda, 0xe9, 0xd2, 0xc2, 0xca, 0xc3, 0x38, 0x30, 0x20, 0x28, 0x18, 0xd8, 0xd0, 0xc0, 0xc8, 0xc9 ] relative_jumps = [0x38, 0x30, 0x20, 0x28, 0x18] +relative_unconditional_jumps = [0xc3, 0x18] #TODO: replace call and a pointer with call and a label call_commands = [0xdc, 0xd4, 0xc4, 0xcc, 0xcd] @@ -608,7 +609,7 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): temp_maybe = maybe_byte temp_maybe += ( ord(rom[offset+1]) << 8) if temp_maybe in opt_table.keys(): - opstr = copy(opt_table[temp_maybe][0]) + opstr = opt_table[temp_maybe][0].lower() if "x" in opstr: for x in range(0, opstr.count("x")): @@ -637,8 +638,8 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): output += spacing + opstr #+ " ; " + hex(offset) output += "\n" - current_byte_number += 1 - offset += 1 + current_byte_number += 2 + offset += 2 elif maybe_byte in opt_table.keys(): op_code = opt_table[maybe_byte] op_code_type = op_code[1] @@ -720,12 +721,12 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000): offset += 1 #duck out if this is jp $24d7 - if current_byte == 0xc3: - if number == 0x24d7: #jp - if not has_outstanding_labels(byte_labels): - keep_reading = False - is_data = False - break + if current_byte == 0xc3 or current_byte in relative_unconditional_jumps: + #if number == 0x24d7: #jp + if not has_outstanding_labels(byte_labels): + keep_reading = False + is_data = False + break else: is_data = True |