summaryrefslogtreecommitdiff
path: root/romstr.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-06-19 22:40:38 -0500
committerBryan Bishop <kanzure@gmail.com>2012-06-19 22:40:38 -0500
commitcd6d6b94373752b63feceebf7753d78738eb0c65 (patch)
tree4243f068a99231a1eae9961262115c1f8c97c1fa /romstr.py
parentaf92ca3e66db7af2d76c1a0ae938f43a0d4cfc87 (diff)
remove debug lines
original-commit-id: 9a4158462b45197631cc30b30bbbe31d900a38ec
Diffstat (limited to 'romstr.py')
-rw-r--r--romstr.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/romstr.py b/romstr.py
index c8b3b5c..d318540 100644
--- a/romstr.py
+++ b/romstr.py
@@ -201,8 +201,6 @@ class Asm:
# all two-byte opcodes also have their first byte in there somewhere
if (current_byte in opt_table.keys()) or ((current_byte + (next_byte << 8)) in opt_table.keys()):
- print "debug2"
-
# this might be a two-byte opcode
possible_opcode = current_byte + (next_byte << 8)
@@ -225,7 +223,6 @@ class Asm:
asm_command["opnumberthing"] = optype
if "x" in opstr:
- print "debug3"
for x in range(0, opstr.count("x")):
insertion = ord(rom[offset + 1])
@@ -240,7 +237,6 @@ class Asm:
offset += 1
if "?" in opstr:
- print "debug4"
for y in range(0, opstr.count("?")):
byte1 = ord(rom[offset + 1])
byte2 = ord(rom[offset + 2])
@@ -260,21 +256,24 @@ class Asm:
# Check for relative jumps, construct the formatted asm line.
# Also set the usage of labels.
if current_byte in [0x18, 0x20] + relative_jumps: # jr or jr nz
- print "debug5"
-
# generate a label for the byte we're jumping to
target_address = offset + 2 + c_int8(ord(rom[offset + 1])).value
if target_address in asm_commands.keys():
- print "debug6"
asm_commands[target_address]["references"] += 1
remote_label = "asm_" + hex(target_address)
asm_commands[target_address]["current_label"] = remote_label
asm_command["remote_label"] = remote_label
- asm_command["use_remote_label"] = True
+ # Not sure how to set this, can't be True because an
+ # address referenced multiple times will use a label
+ # despite the label not necessarily being used in the
+ # output. The "use_remote_label" values should be
+ # calculated when rendering the asm output, based on
+ # which addresses and which op codes will be displayed
+ # (within the range).
+ asm_command["use_remote_label"] = "unknown"
else:
- print "debug7"
remote_label = "asm_" + hex(target_address)
# This remote address might not be part of this
@@ -311,7 +310,6 @@ class Asm:
used_3d97 = True
if current_byte == 0xc3 or current_byte in relative_unconditional_jumps:
- print "debug8"
if current_byte == 0xc3:
if number == 0x3d97:
used_3d97 = True
@@ -322,7 +320,6 @@ class Asm:
# stop reading at a jump, relative jump or return
if current_byte in end_08_scripts_with:
- print "debug9"
is_data = False
if not self.has_outstanding_labels(asm_commands, offset):