summaryrefslogtreecommitdiff
path: root/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-05-23 17:56:34 -0500
committerBryan Bishop <kanzure@gmail.com>2012-05-23 17:56:34 -0500
commit60c1e32216656d0e73e7997e65ed22bd05fc90b5 (patch)
tree8fafc72d533bc1db5a78c83e96f3a6e343761522 /crystal.py
parent8021dbee599a58c8c12d93f8238906cbf244ea01 (diff)
fix PokedexText
original-commit-id: 38eae01fcd134b4ef55ae8cac62626ff52015687
Diffstat (limited to 'crystal.py')
-rw-r--r--crystal.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/crystal.py b/crystal.py
index ec1084d..4463565 100644
--- a/crystal.py
+++ b/crystal.py
@@ -2325,8 +2325,8 @@ class MainText(TextCommand):
offset = self.address
# the code below assumes we're jumping past a $0 byte
- if use_zero == False:
- offset = offset - 1
+ if self.use_zero == False:
+ offset = offset -1
# read until $50, $57 or $58 (not sure about $58...)
jump57 = how_many_until(chr(0x57), offset)
@@ -2356,10 +2356,10 @@ class MainText(TextCommand):
if self.size < 2 or len(self.bytes) < 1:
raise Exception, "$0 text command can't end itself with no follow-on bytes"
- if use_zero:
+ if self.use_zero:
output = "db $0"
else:
- output += "db "
+ output = ""
# db $0, $57 or db $0, $50 or w/e
if self.size == 2 and len(self.bytes) == 1:
@@ -2379,6 +2379,10 @@ class MainText(TextCommand):
# has a $50 or $57 been passed yet?
end = False
+ if not self.use_zero:
+ new_line = True
+ was_comma = False
+
for byte in self.bytes:
if end:
raise Exception, "the text ended due to a $50 or $57 but there are more bytes?"