diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-05-05 13:30:22 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-05-05 13:30:22 -0500 |
commit | e3b6c0f4d232d3f959f4c30c6a8ccec9ca46d126 (patch) | |
tree | ce2b439b45c5910a48d6248be479c7b9a4db884c | |
parent | 57d11561b0bb0c5e2233a2a2eb86d481e98b0cc3 (diff) |
preprocessor compatibility with text commands
-rw-r--r-- | preprocessor.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/preprocessor.py b/preprocessor.py index 8f1771fbf..c681049ad 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -13,6 +13,7 @@ from extras.crystal import command_classes, \ PointerLabelAfterBank, \ MoneyByteParam, \ ItemFragment, \ + TextEndingCommand, \ text_command_classes macros = command_classes + \ @@ -23,7 +24,7 @@ macros = command_classes + \ PeopleEvent, DataByteWordMacro, ItemFragment, - ] #+ [x[1] for x in text_command_classes] + ] + [x[1] for x in text_command_classes] chars = { "ガ": 0x05, @@ -436,6 +437,14 @@ def macro_translator(macro, token, line): # write out a comment showing the original line sys.stdout.write("; original_line: " + original_line) + + # "db" is a macro because of TextEndingCommand + # rgbasm can handle "db" so no preprocessing is required + # (don't check its param count) + if macro.macro_name == "db" and macro == TextEndingCommand: + sys.stdout.write(original_line) + return + # certain macros don't need an initial byte written # do: all scripting macros # don't: signpost, warp_def, person_event, xy_trigger |