summaryrefslogtreecommitdiff
path: root/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-05-04 22:03:52 -0500
committerBryan Bishop <kanzure@gmail.com>2012-05-04 22:03:52 -0500
commit7869d2d3ad380e3ecf53bf8e18572079b1f0a85a (patch)
tree582de9aeaf1f12aa3f2a8e1b375df9cc0f1e321f /crystal.py
parentc988390334893ee5211c8d85b9e9ce49a4f41fc0 (diff)
fix the use of text_command_classes (not the same format as command_classes)
original-commit-id: 2489165312a0ee2cc45d2a03edbed7623f124b73
Diffstat (limited to 'crystal.py')
-rw-r--r--crystal.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/crystal.py b/crystal.py
index 0746c7e..d3d0cee 100644
--- a/crystal.py
+++ b/crystal.py
@@ -458,8 +458,8 @@ class NewTextScript:
# match the command id byte to a scripting command class like MainText
for class_ in text_command_classes:
- if class_.id == cur_byte:
- scripting_command_class = class_
+ if class_[1].id == cur_byte:
+ scripting_command_class = class_[1]
# no matching command found
if scripting_command_class == None:
@@ -487,9 +487,10 @@ class NewTextScript:
# store the script in the global table/map thing
script_parse_table[start_address:current_address] = self
-
- asm_output = "\n".join([command.to_asm() for command in commands])
- print "--------------\n"+asm_output
+
+ if self.debug:
+ asm_output = "\n".join([command.to_asm() for command in commands])
+ print "--------------\n"+asm_output
# store the script
self.commands = commands