summaryrefslogtreecommitdiff
path: root/preprocessor.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-04-27 16:33:37 -0500
committerBryan Bishop <kanzure@gmail.com>2012-04-27 16:33:37 -0500
commit45c41795f517f420bc0b6cef4d061f767d90915c (patch)
treeb4932c40396aef3925b86c7467df7c1102cfdef0 /preprocessor.py
parent14a35baa3fdc794c3a4f037530554768926e6465 (diff)
possibly fix preprocessor/checkmoney issues
Diffstat (limited to 'preprocessor.py')
-rw-r--r--preprocessor.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/preprocessor.py b/preprocessor.py
index 336dc18b0..bd60141cd 100644
--- a/preprocessor.py
+++ b/preprocessor.py
@@ -10,7 +10,8 @@ from extras.crystal import command_classes, \
PeopleEvent, \
DataByteWordMacro, \
PointerLabelBeforeBank, \
- PointerLabelAfterBank
+ PointerLabelAfterBank, \
+ MoneyByteParam
macros = command_classes + \
[Warp, XYTrigger, Signpost, PeopleEvent, DataByteWordMacro]
@@ -450,6 +451,8 @@ def macro_translator(macro, token, line):
elif param_klass.byte_type == "dw":
if param_klass.size == 2:
allowed_length += 1 # just label
+ elif param_klass == MoneyByteParam:
+ allowed_length += 1
elif param_klass.size == 3:
allowed_length += 2 # bank and label
else:
@@ -488,12 +491,15 @@ def macro_translator(macro, token, line):
# write the pointer second
sys.stdout.write("dw " + params[index+1] + "\n")
index += 2
- elif size == 3 and issubclass(param_klass, PointerLabelAfterBank):
+ elif size == 3 and (issubclass(param_klass, PointerLabelAfterBank):
# write the pointer first
sys.stdout.write("dw " + params[index] + "\n")
# write the bank second
sys.stdout.write("db " + params[index+1] + "\n")
index += 2
+ elif size == 3 and issubclass(param_klass, MoneyByteParam):
+ sys.stdout.write("db " + MoneyByteParam.from_asm(params[index]) + "\n")
+ index += 1
else:
raise Exception, "dunno what to do with this macro " + \
"param (" + str(param_klass) + ") " + "on this line: " + \