diff options
| author | Rangi <sylvie.oukaour+rangi42@gmail.com> | 2025-11-15 18:17:32 -0500 |
|---|---|---|
| committer | Rangi <sylvie.oukaour+rangi42@gmail.com> | 2025-11-15 18:17:32 -0500 |
| commit | 123159cc39af1a8d3f73cecc833aae15da53c772 (patch) | |
| tree | a5ab2a2f7d533ffb19934aaa86b5a3b2f366beaf /tools | |
| parent | Merge branch 'master' of https://github.com/pret/pokered (diff) | |
| download | pokeyellow-123159cc39af1a8d3f73cecc833aae15da53c772.tar.gz pokeyellow-123159cc39af1a8d3f73cecc833aae15da53c772.tar.xz pokeyellow-123159cc39af1a8d3f73cecc833aae15da53c772.zip | |
Fix tools/unnamed.py
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/unnamed.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/unnamed.py b/tools/unnamed.py index f3384eb0..4bd63a5b 100755 --- a/tools/unnamed.py +++ b/tools/unnamed.py @@ -90,19 +90,19 @@ for objfile in objects: elif magic == b'RGB9': obj_ver = 10 + unpack_from('<I', file)[0] - if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22]: + if obj_ver not in [6, 10, 11, 12, 13] and obj_ver < 15: print(f"Error: File '{objfile}' is of an unknown format.", file=sys.stderr) sys.exit(1) num_symbols = unpack_from('<I', file)[0] unpack_from('<I', file) # skip num sections - if obj_ver in [16, 17, 18, 19, 20, 21, 22]: + if obj_ver >= 16: node_filenames = [] num_nodes = unpack_from('<I', file)[0] for x in range(num_nodes): unpack_from('<II', file) # parent id, parent line no - node_type = unpack_from('<B', file)[0] + node_type = unpack_from('<B', file)[0] & 0x7f if node_type: node_filenames.append(read_string(file)) else: @@ -117,7 +117,7 @@ for objfile in objects: sym_type = symtype(unpack_from('<B', file)[0] & 0x7f) if sym_type == symtype.IMPORT: continue - if obj_ver in [16, 17, 18, 19, 20, 21, 22]: + if obj_ver >= 16: sym_fileno = unpack_from('<I', file)[0] sym_filename = node_filenames[sym_fileno] else: |
