diff options
author | yenatch <yenatch@gmail.com> | 2013-12-06 22:40:46 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-12-07 20:01:50 -0500 |
commit | 120ba9664992cada4781e4d524304e4499e9083f (patch) | |
tree | 93dbfcf49a5835d5708c6b6a58c608e60297d773 /preprocessor.py | |
parent | bacc4594c0772dab004e4f97e21529a523918a89 (diff) |
handle preprocessing in one python procress; export asm labels
instead of running a process for each file, one process handles all files
rgbasm requires label EXPORT definitions for cross-object compiling. this is handled by globals.asm
Diffstat (limited to 'preprocessor.py')
-rw-r--r-- | preprocessor.py | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/preprocessor.py b/preprocessor.py index 294e9ccb..317a2fe6 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -1,10 +1,17 @@ # -*- coding: utf-8 -*- import extras.pokemontools.preprocessor as preprocessor + import extras.pokemontools.configuration as configuration +config = configuration.Config() import sys +from extras.pokemontools.crystal import ( + callchannel, + loopchannel, +) + chars = { "ガ": 0x05, "ギ": 0x06, @@ -260,14 +267,19 @@ chars = { "9": 0xFF, } -preprocessor.chars = chars +def load_pokered_macros(): + macros = [callchannel, loopchannel] + return macros -from extras.pokemontools.crystal import ( - callchannel, - loopchannel, -) +def setup_processor(): + preprocessor.chars = chars + macros = load_pokered_macros() + processor = preprocessor.Preprocessor(config, macros) + return processor -config = configuration.Config() -macros = [callchannel, loopchannel] -processor = preprocessor.Preprocessor(config, macros) -processor.preprocess() +def main(): + processor = setup_processor() + processor.preprocess() + +if __name__ == '__main__': + main() |