diff options
author | Andrew Martinek <andrewrmartinek@gmail.com> | 2019-10-09 00:27:25 -0400 |
---|---|---|
committer | Andrew Martinek <andrewrmartinek@gmail.com> | 2019-10-09 00:27:25 -0400 |
commit | 6a51305cf5ad95f93bc80122939744ad77b30b79 (patch) | |
tree | e6793a6ab42e4f636014e5d35d88eb21bc6091ba /tools/script_extractor.py | |
parent | cb88ee5a13498f060da1be80eb0cc0fcd1357a05 (diff) |
More features for progress.py, added better argparsing for both!
Diffstat (limited to 'tools/script_extractor.py')
-rw-r--r-- | tools/script_extractor.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/script_extractor.py b/tools/script_extractor.py index 7f80b01..a4e933e 100644 --- a/tools/script_extractor.py +++ b/tools/script_extractor.py @@ -73,6 +73,7 @@ def main(): parser = argparse.ArgumentParser(description='Pokemon TCG Script Extractor') parser.add_argument('--noauto', action='store_true', help='turns off automatic script parsing') parser.add_argument('--error', action='store_true', help='stops execution if an error occurs') + parser.add_argument('-r', '--rom', default="baserom.gbc", help='rom file to extract script from') parser.add_argument('location', help='location to extract from. May be local to bank or global.') args = parser.parse_args() loc = int(args.location,0) @@ -84,12 +85,12 @@ def main(): # this is a list of every start location we've read to avoid infinite loops exploredList = [] - with open("baserom.gbc", "rb") as file: + with open(args.rom, "rb") as file: game_data = file.read() - auto = True + auto = not args.noauto end = False - ignore_broken = True + ignore_broken = not args.error while (len(branchList) > 0): branchList.sort() # export parts in order somewhat loc = branchList.pop(0) + 0x8000 |