diff options
| author | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2013-12-10 14:08:08 -0500 |
|---|---|---|
| committer | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2013-12-10 14:08:08 -0500 |
| commit | 4e530306781ccebf483dd86c39bd53bd4ca97fbd (patch) | |
| tree | 034ae854a665d13ea2771c6d7998ab1ea8f641fa /preprocessor.py | |
| parent | Misc clean up (diff) | |
| parent | Use safer and more standard POSIX find options. (diff) | |
| download | pokeyellow-4e530306781ccebf483dd86c39bd53bd4ca97fbd.tar.gz pokeyellow-4e530306781ccebf483dd86c39bd53bd4ca97fbd.tar.xz pokeyellow-4e530306781ccebf483dd86c39bd53bd4ca97fbd.zip | |
Merge branch 'master' of https://github.com/iimarckus/pokered
Conflicts:
main.asm
Diffstat (limited to '')
| -rw-r--r-- | preprocessor.py (renamed from textpre.py) | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/textpre.py b/preprocessor.py index 294e9ccb..cb9353af 100644 --- a/textpre.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,21 @@ 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() + output = processor.preprocess() + processor.update_globals() + return output + +if __name__ == '__main__': + main() |
