From 13c2378a8075fc294bd8cf84e4bce4acd4c35c0d Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 14 May 2013 21:50:43 -0400 Subject: gbz80disasm: space out blocks of asm original-commit-id: 3cf6603b455530fa0c17e946118484a0126e2bf9 --- gbz80disasm.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gbz80disasm.py b/gbz80disasm.py index dd69be2..354490e 100644 --- a/gbz80disasm.py +++ b/gbz80disasm.py @@ -635,6 +635,7 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000, include_last_add if offset in byte_labels.keys(): line_label = byte_labels[offset]["name"] byte_labels[offset]["usage"] += 1 + output += "\n" else: line_label = asm_label(offset) byte_labels[offset] = {} @@ -819,6 +820,9 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000, include_last_add #offset += 1 #current_byte_number += 1 + if current_byte in relative_unconditional_jumps + end_08_scripts_with: + output += "\n" + first_loop = False #clean up unused labels @@ -828,6 +832,9 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000, include_last_add if label_line["usage"] == 0: output = output.replace((label_line["name"] + "\n").lower(), "") + #tone down excessive spacing + output = output.replace("\n\n\n","\n\n") + #add the offset of the final location if include_last_address: output += "; " + hex(offset) -- cgit v1.2.3