diff options
-rwxr-xr-x | tools/unnamed.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/unnamed.py b/tools/unnamed.py index cea500fcd..2c7cdd389 100755 --- a/tools/unnamed.py +++ b/tools/unnamed.py @@ -73,8 +73,16 @@ if not objects: files = {} for objfile in objects: f = open(objfile, "rb") - if unpack_file("4s", f)[0] != b'RGB6': - print("Error: File '%s' is of an unknown format." % filename, file=stderr) + obj_ver = None + + magic = unpack_file("4s", f)[0] + if magic == b'RGB6': + obj_ver = 6 + elif magic == b'RGB9': + obj_ver = 10 + unpack_file("<I", f)[0] + + if obj_ver not in [6, 10]: + print("Error: File '%s' is of an unknown format." % objfile, file=stderr) exit(1) num_symbols = unpack_file("<II", f)[0] |