summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-05-23 17:38:15 -0500
committerBryan Bishop <kanzure@gmail.com>2012-05-23 17:38:15 -0500
commit8d7df87373b224ac8ceb874902960949686f209e (patch)
tree6fc3113cc1fc7779e25aba4d89b0f88480a1d0bb
parent54003acc82b64c65a3b51b582c819bb4c22aeea1 (diff)
use PokedexText to parse text-script-like text without the first bash command
original-commit-id: 0c778f2930d91dbfde77b75c0147240c713a5085
-rw-r--r--crystal.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/crystal.py b/crystal.py
index b7b29e7..b0b95b2 100644
--- a/crystal.py
+++ b/crystal.py
@@ -2319,6 +2319,7 @@ class MainText(TextCommand):
"Write text. Structure: [00][Text][0x50 (ends code)]"
id = 0x0
macro_name = "do_text"
+ use_zero = True
def parse(self):
offset = self.address
@@ -2351,7 +2352,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"
- output = "db $0"
+ if use_zero:
+ output = "db $0"
+ else:
+ output += "db "
# db $0, $57 or db $0, $50 or w/e
if self.size == 2 and len(self.bytes) == 1:
@@ -2503,6 +2507,9 @@ class MainText(TextCommand):
return output
+class PokedexText(MainText):
+ use_zero = False
+
class WriteTextFromRAM(TextCommand):
"""
Write text from ram. Structure: [01][Ram address (2byte)]