shithub: pokered

Download patch

ref: 2c24aa3510d833f6d4bec31f8da50aac2d825e72
parent: 2e22ddb2b6ad4841c0620995a1cceedec2b6b86f
author: Bryan Bishop <kanzure@gmail.com>
date: Thu Jan 12 08:21:05 EST 2012

stop disassembling when unconditional relative jumps go back

This adds the condition that it should stop disassembling even if there are
unsatisfied labels (example: from before the text script began).

hg-commit-id: 0b6ebcb02348


--- a/extras/gbz80disasm.py
+++ b/extras/gbz80disasm.py
@@ -739,7 +739,7 @@
 
             #stop reading at a jump, relative jump or return
             if current_byte in end_08_scripts_with or (current_byte == 0x18 and target_address < offset):
-                if not has_outstanding_labels(byte_labels):
+                if not has_outstanding_labels(byte_labels) or (current_byte == 0x18 and target_address < offset):
                     keep_reading = False
                     is_data = False #cleanup
                     break