From f274ebe21aaf09053bcc100ed59fc6b47a587b31 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 24 Jan 2021 23:45:43 +0900 Subject: [PATCH 1/7] extension updates for splat update --- tools/splat.yaml | 3 ++- tools/splat_ext/PaperMarioMapFS.py | 4 ++-- tools/splat_ext/PaperMarioMessages.py | 2 +- tools/splat_ext/PaperMarioNpcSprites.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/splat.yaml b/tools/splat.yaml index df26d849d6..52f0b34be1 100644 --- a/tools/splat.yaml +++ b/tools/splat.yaml @@ -7,7 +7,8 @@ options: ld_o_replace_extension: False ld_addrs_header: include/ld_addrs.h extensions: splat_ext - symbol_addrs: tools/symbol_addrs.txt + symbol_addrs_path: tools/symbol_addrs.txt + platform: n64 segments: - name: header type: header diff --git a/tools/splat_ext/PaperMarioMapFS.py b/tools/splat_ext/PaperMarioMapFS.py index a2ff417ba1..3550ffa124 100644 --- a/tools/splat_ext/PaperMarioMapFS.py +++ b/tools/splat_ext/PaperMarioMapFS.py @@ -1,7 +1,7 @@ import os -from segtypes.segment import N64Segment +from segtypes.n64.segment import N64Segment from pathlib import Path -from util import Yay0decompress +from util.n64 import Yay0decompress def decode_null_terminated_ascii(data): diff --git a/tools/splat_ext/PaperMarioMessages.py b/tools/splat_ext/PaperMarioMessages.py index 5cad55af5d..af29d66a84 100644 --- a/tools/splat_ext/PaperMarioMessages.py +++ b/tools/splat_ext/PaperMarioMessages.py @@ -1,4 +1,4 @@ -from segtypes.segment import N64Segment +from segtypes.n64.segment import N64Segment from pathlib import Path CHARSET = { diff --git a/tools/splat_ext/PaperMarioNpcSprites.py b/tools/splat_ext/PaperMarioNpcSprites.py index cd7be31575..51a4deee02 100644 --- a/tools/splat_ext/PaperMarioNpcSprites.py +++ b/tools/splat_ext/PaperMarioNpcSprites.py @@ -1,6 +1,6 @@ -from segtypes.segment import N64Segment +from segtypes.n64.segment import N64Segment from pathlib import Path -from util import Yay0decompress +from util.n64 import Yay0decompress from util.iter import iter_in_groups from util.color import unpack_color import png From dc7285954620634e352b43bcae320ba1f8dd8de7 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 25 Jan 2021 00:19:48 +0900 Subject: [PATCH 2/7] rename --- configure.py | 2 +- tools/{n64splat => splat}/.gitignore | 0 tools/{n64splat => splat}/.gitrepo | 2 +- tools/{n64splat => splat}/Makefile | 0 tools/{n64splat => splat}/README.md | 0 tools/{n64splat => splat}/create_config.py | 0 tools/{n64splat => splat}/list_objects.py | 0 tools/{n64splat => splat}/requirements.txt | 0 tools/{n64splat => splat}/segtypes/Yay0.py | 0 tools/{n64splat => splat}/segtypes/__init__.py | 0 tools/{n64splat => splat}/segtypes/bin.py | 0 tools/{n64splat => splat}/segtypes/ci4.py | 0 tools/{n64splat => splat}/segtypes/ci8.py | 0 tools/{n64splat => splat}/segtypes/code.py | 0 tools/{n64splat => splat}/segtypes/header.py | 0 tools/{n64splat => splat}/segtypes/i4.py | 0 tools/{n64splat => splat}/segtypes/i8.py | 0 tools/{n64splat => splat}/segtypes/ia16.py | 0 tools/{n64splat => splat}/segtypes/ia4.py | 0 tools/{n64splat => splat}/segtypes/ia8.py | 0 tools/{n64splat => splat}/segtypes/palette.py | 0 tools/{n64splat => splat}/segtypes/rgba16.py | 0 tools/{n64splat => splat}/segtypes/rgba32.py | 0 tools/{n64splat => splat}/segtypes/segment.py | 0 tools/{n64splat => splat}/split.py | 0 tools/{n64splat => splat}/util/Yay0decompress.c | 0 tools/{n64splat => splat}/util/Yay0decompress.py | 0 tools/{n64splat => splat}/util/__init__.py | 0 tools/{n64splat => splat}/util/color.py | 0 tools/{n64splat => splat}/util/find_code_length.py | 0 tools/{n64splat => splat}/util/floats.py | 0 tools/{n64splat => splat}/util/iter.py | 0 tools/{n64splat => splat}/util/log.py | 0 tools/{n64splat => splat}/util/rominfo.py | 0 34 files changed, 2 insertions(+), 2 deletions(-) rename tools/{n64splat => splat}/.gitignore (100%) rename tools/{n64splat => splat}/.gitrepo (88%) rename tools/{n64splat => splat}/Makefile (100%) rename tools/{n64splat => splat}/README.md (100%) rename tools/{n64splat => splat}/create_config.py (100%) rename tools/{n64splat => splat}/list_objects.py (100%) rename tools/{n64splat => splat}/requirements.txt (100%) rename tools/{n64splat => splat}/segtypes/Yay0.py (100%) rename tools/{n64splat => splat}/segtypes/__init__.py (100%) rename tools/{n64splat => splat}/segtypes/bin.py (100%) rename tools/{n64splat => splat}/segtypes/ci4.py (100%) rename tools/{n64splat => splat}/segtypes/ci8.py (100%) rename tools/{n64splat => splat}/segtypes/code.py (100%) rename tools/{n64splat => splat}/segtypes/header.py (100%) rename tools/{n64splat => splat}/segtypes/i4.py (100%) rename tools/{n64splat => splat}/segtypes/i8.py (100%) rename tools/{n64splat => splat}/segtypes/ia16.py (100%) rename tools/{n64splat => splat}/segtypes/ia4.py (100%) rename tools/{n64splat => splat}/segtypes/ia8.py (100%) rename tools/{n64splat => splat}/segtypes/palette.py (100%) rename tools/{n64splat => splat}/segtypes/rgba16.py (100%) rename tools/{n64splat => splat}/segtypes/rgba32.py (100%) rename tools/{n64splat => splat}/segtypes/segment.py (100%) rename tools/{n64splat => splat}/split.py (100%) rename tools/{n64splat => splat}/util/Yay0decompress.c (100%) rename tools/{n64splat => splat}/util/Yay0decompress.py (100%) rename tools/{n64splat => splat}/util/__init__.py (100%) rename tools/{n64splat => splat}/util/color.py (100%) rename tools/{n64splat => splat}/util/find_code_length.py (100%) rename tools/{n64splat => splat}/util/floats.py (100%) rename tools/{n64splat => splat}/util/iter.py (100%) rename tools/{n64splat => splat}/util/log.py (100%) rename tools/{n64splat => splat}/util/rominfo.py (100%) diff --git a/configure.py b/configure.py index 56cb11c625..b1f2b1f394 100755 --- a/configure.py +++ b/configure.py @@ -10,7 +10,7 @@ from subprocess import PIPE import subprocess import hashlib -sys.path.append(os.path.dirname(__file__) + "/tools/n64splat") +sys.path.append(os.path.dirname(__file__) + "/tools/splat") import split INCLUDE_ASM_RE = re.compile(r"_INCLUDE_ASM\([^,]+, ([^,]+), ([^,)]+)") # note _ prefix diff --git a/tools/n64splat/.gitignore b/tools/splat/.gitignore similarity index 100% rename from tools/n64splat/.gitignore rename to tools/splat/.gitignore diff --git a/tools/n64splat/.gitrepo b/tools/splat/.gitrepo similarity index 88% rename from tools/n64splat/.gitrepo rename to tools/splat/.gitrepo index a36d64ec01..6b26c87759 100644 --- a/tools/n64splat/.gitrepo +++ b/tools/splat/.gitrepo @@ -4,7 +4,7 @@ ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme ; [subrepo] - remote = https://github.com/ethteck/n64splat.git + remote = https://github.com/ethteck/splat.git branch = master commit = 7574db712ef19ca420904c82d3559e9ac4b8c5f5 parent = 86760369a5ab977c037c21aebf6f10484570642f diff --git a/tools/n64splat/Makefile b/tools/splat/Makefile similarity index 100% rename from tools/n64splat/Makefile rename to tools/splat/Makefile diff --git a/tools/n64splat/README.md b/tools/splat/README.md similarity index 100% rename from tools/n64splat/README.md rename to tools/splat/README.md diff --git a/tools/n64splat/create_config.py b/tools/splat/create_config.py similarity index 100% rename from tools/n64splat/create_config.py rename to tools/splat/create_config.py diff --git a/tools/n64splat/list_objects.py b/tools/splat/list_objects.py similarity index 100% rename from tools/n64splat/list_objects.py rename to tools/splat/list_objects.py diff --git a/tools/n64splat/requirements.txt b/tools/splat/requirements.txt similarity index 100% rename from tools/n64splat/requirements.txt rename to tools/splat/requirements.txt diff --git a/tools/n64splat/segtypes/Yay0.py b/tools/splat/segtypes/Yay0.py similarity index 100% rename from tools/n64splat/segtypes/Yay0.py rename to tools/splat/segtypes/Yay0.py diff --git a/tools/n64splat/segtypes/__init__.py b/tools/splat/segtypes/__init__.py similarity index 100% rename from tools/n64splat/segtypes/__init__.py rename to tools/splat/segtypes/__init__.py diff --git a/tools/n64splat/segtypes/bin.py b/tools/splat/segtypes/bin.py similarity index 100% rename from tools/n64splat/segtypes/bin.py rename to tools/splat/segtypes/bin.py diff --git a/tools/n64splat/segtypes/ci4.py b/tools/splat/segtypes/ci4.py similarity index 100% rename from tools/n64splat/segtypes/ci4.py rename to tools/splat/segtypes/ci4.py diff --git a/tools/n64splat/segtypes/ci8.py b/tools/splat/segtypes/ci8.py similarity index 100% rename from tools/n64splat/segtypes/ci8.py rename to tools/splat/segtypes/ci8.py diff --git a/tools/n64splat/segtypes/code.py b/tools/splat/segtypes/code.py similarity index 100% rename from tools/n64splat/segtypes/code.py rename to tools/splat/segtypes/code.py diff --git a/tools/n64splat/segtypes/header.py b/tools/splat/segtypes/header.py similarity index 100% rename from tools/n64splat/segtypes/header.py rename to tools/splat/segtypes/header.py diff --git a/tools/n64splat/segtypes/i4.py b/tools/splat/segtypes/i4.py similarity index 100% rename from tools/n64splat/segtypes/i4.py rename to tools/splat/segtypes/i4.py diff --git a/tools/n64splat/segtypes/i8.py b/tools/splat/segtypes/i8.py similarity index 100% rename from tools/n64splat/segtypes/i8.py rename to tools/splat/segtypes/i8.py diff --git a/tools/n64splat/segtypes/ia16.py b/tools/splat/segtypes/ia16.py similarity index 100% rename from tools/n64splat/segtypes/ia16.py rename to tools/splat/segtypes/ia16.py diff --git a/tools/n64splat/segtypes/ia4.py b/tools/splat/segtypes/ia4.py similarity index 100% rename from tools/n64splat/segtypes/ia4.py rename to tools/splat/segtypes/ia4.py diff --git a/tools/n64splat/segtypes/ia8.py b/tools/splat/segtypes/ia8.py similarity index 100% rename from tools/n64splat/segtypes/ia8.py rename to tools/splat/segtypes/ia8.py diff --git a/tools/n64splat/segtypes/palette.py b/tools/splat/segtypes/palette.py similarity index 100% rename from tools/n64splat/segtypes/palette.py rename to tools/splat/segtypes/palette.py diff --git a/tools/n64splat/segtypes/rgba16.py b/tools/splat/segtypes/rgba16.py similarity index 100% rename from tools/n64splat/segtypes/rgba16.py rename to tools/splat/segtypes/rgba16.py diff --git a/tools/n64splat/segtypes/rgba32.py b/tools/splat/segtypes/rgba32.py similarity index 100% rename from tools/n64splat/segtypes/rgba32.py rename to tools/splat/segtypes/rgba32.py diff --git a/tools/n64splat/segtypes/segment.py b/tools/splat/segtypes/segment.py similarity index 100% rename from tools/n64splat/segtypes/segment.py rename to tools/splat/segtypes/segment.py diff --git a/tools/n64splat/split.py b/tools/splat/split.py similarity index 100% rename from tools/n64splat/split.py rename to tools/splat/split.py diff --git a/tools/n64splat/util/Yay0decompress.c b/tools/splat/util/Yay0decompress.c similarity index 100% rename from tools/n64splat/util/Yay0decompress.c rename to tools/splat/util/Yay0decompress.c diff --git a/tools/n64splat/util/Yay0decompress.py b/tools/splat/util/Yay0decompress.py similarity index 100% rename from tools/n64splat/util/Yay0decompress.py rename to tools/splat/util/Yay0decompress.py diff --git a/tools/n64splat/util/__init__.py b/tools/splat/util/__init__.py similarity index 100% rename from tools/n64splat/util/__init__.py rename to tools/splat/util/__init__.py diff --git a/tools/n64splat/util/color.py b/tools/splat/util/color.py similarity index 100% rename from tools/n64splat/util/color.py rename to tools/splat/util/color.py diff --git a/tools/n64splat/util/find_code_length.py b/tools/splat/util/find_code_length.py similarity index 100% rename from tools/n64splat/util/find_code_length.py rename to tools/splat/util/find_code_length.py diff --git a/tools/n64splat/util/floats.py b/tools/splat/util/floats.py similarity index 100% rename from tools/n64splat/util/floats.py rename to tools/splat/util/floats.py diff --git a/tools/n64splat/util/iter.py b/tools/splat/util/iter.py similarity index 100% rename from tools/n64splat/util/iter.py rename to tools/splat/util/iter.py diff --git a/tools/n64splat/util/log.py b/tools/splat/util/log.py similarity index 100% rename from tools/n64splat/util/log.py rename to tools/splat/util/log.py diff --git a/tools/n64splat/util/rominfo.py b/tools/splat/util/rominfo.py similarity index 100% rename from tools/n64splat/util/rominfo.py rename to tools/splat/util/rominfo.py From 15de829b588ebfb9fb049ddfed2e454d3e098217 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 25 Jan 2021 00:19:56 +0900 Subject: [PATCH 3/7] git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "687885c4d" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "687885c4d" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" --- tools/splat/.gitignore | 2 +- tools/splat/.gitrepo | 4 +- tools/splat/CHANGELOG.md | 12 ++++ tools/splat/Makefile | 4 +- tools/splat/README.md | 10 +-- tools/splat/create_config.py | 18 ++--- tools/splat/segtypes/{ => n64}/Yay0.py | 5 +- tools/splat/segtypes/n64/__init__.py | 0 tools/splat/segtypes/{ => n64}/bin.py | 2 +- tools/splat/segtypes/{ => n64}/ci4.py | 2 +- tools/splat/segtypes/{ => n64}/ci8.py | 5 +- tools/splat/segtypes/{ => n64}/code.py | 4 +- tools/splat/segtypes/{ => n64}/header.py | 3 +- tools/splat/segtypes/{ => n64}/i4.py | 2 +- tools/splat/segtypes/{ => n64}/i8.py | 2 +- tools/splat/segtypes/{ => n64}/ia16.py | 2 +- tools/splat/segtypes/{ => n64}/ia4.py | 3 +- tools/splat/segtypes/{ => n64}/ia8.py | 3 +- tools/splat/segtypes/{ => n64}/palette.py | 4 +- tools/splat/segtypes/{ => n64}/rgba16.py | 5 +- tools/splat/segtypes/{ => n64}/rgba32.py | 2 +- tools/splat/segtypes/n64/segment.py | 4 ++ tools/splat/segtypes/segment.py | 8 +-- tools/splat/split.py | 71 ++++++++++--------- tools/splat/util/{ => n64}/Yay0decompress.c | 0 tools/splat/util/{ => n64}/Yay0decompress.py | 0 .../splat/util/{ => n64}/find_code_length.py | 5 +- tools/splat/util/{ => n64}/rominfo.py | 4 +- tools/splat/util/n64/symbol.py | 12 ++++ 29 files changed, 106 insertions(+), 92 deletions(-) create mode 100644 tools/splat/CHANGELOG.md rename tools/splat/segtypes/{ => n64}/Yay0.py (88%) create mode 100644 tools/splat/segtypes/n64/__init__.py rename tools/splat/segtypes/{ => n64}/bin.py (93%) rename tools/splat/segtypes/{ => n64}/ci4.py (90%) rename tools/splat/segtypes/{ => n64}/ci8.py (94%) rename tools/splat/segtypes/{ => n64}/code.py (99%) rename tools/splat/segtypes/{ => n64}/header.py (97%) rename tools/splat/segtypes/{ => n64}/i4.py (93%) rename tools/splat/segtypes/{ => n64}/i8.py (84%) rename tools/splat/segtypes/{ => n64}/ia16.py (83%) rename tools/splat/segtypes/{ => n64}/ia4.py (93%) rename tools/splat/segtypes/{ => n64}/ia8.py (91%) rename tools/splat/segtypes/{ => n64}/palette.py (96%) rename tools/splat/segtypes/{ => n64}/rgba16.py (96%) rename tools/splat/segtypes/{ => n64}/rgba32.py (81%) create mode 100644 tools/splat/segtypes/n64/segment.py rename tools/splat/util/{ => n64}/Yay0decompress.c (100%) rename tools/splat/util/{ => n64}/Yay0decompress.py (100%) rename tools/splat/util/{ => n64}/find_code_length.py (93%) rename tools/splat/util/{ => n64}/rominfo.py (91%) create mode 100644 tools/splat/util/n64/symbol.py diff --git a/tools/splat/.gitignore b/tools/splat/.gitignore index 921e677191..90f0ad8ea3 100644 --- a/tools/splat/.gitignore +++ b/tools/splat/.gitignore @@ -2,4 +2,4 @@ venv/ .vscode/ __pycache__/ -util/Yay0decompress +util/n64/Yay0decompress diff --git a/tools/splat/.gitrepo b/tools/splat/.gitrepo index 6b26c87759..543f264205 100644 --- a/tools/splat/.gitrepo +++ b/tools/splat/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/ethteck/splat.git branch = master - commit = 7574db712ef19ca420904c82d3559e9ac4b8c5f5 - parent = 86760369a5ab977c037c21aebf6f10484570642f + commit = 687885c4d8bcb86d399dbb7dcd660ad8548acdf7 + parent = dc7285954620634e352b43bcae320ba1f8dd8de7 method = merge cmdver = 0.4.3 diff --git a/tools/splat/CHANGELOG.md b/tools/splat/CHANGELOG.md new file mode 100644 index 0000000000..8e4f9f6d1a --- /dev/null +++ b/tools/splat/CHANGELOG.md @@ -0,0 +1,12 @@ +# splat Release Notes + +## 0.5 +* n64splat name changed to splat + * Some refactoring was done to support other platforms besides n64 in the future + * New `platform` option, which defaults to `n64` + * This will cause breaking changes in custom segments, so please refer to one of the changes in one of the n64 base segments for details +* Support for custom artifact paths + * New `undefined_syms_auto_path` option + * New `undefined_funcs_auto_path` option + * New `cache_path` option + * (All path-like options' names now end with `_path`) diff --git a/tools/splat/Makefile b/tools/splat/Makefile index cca29fc676..603f567fad 100644 --- a/tools/splat/Makefile +++ b/tools/splat/Makefile @@ -5,7 +5,7 @@ default: all all: Yay0decompress Yay0decompress: - gcc $(UTIL_DIR)/Yay0decompress.c -fPIC -shared -O3 -o $(UTIL_DIR)/Yay0decompress + gcc $(UTIL_DIR)/n64/Yay0decompress.c -fPIC -shared -O3 -o $(UTIL_DIR)/n64/Yay0decompress clean: - rm -f $(UTIL_DIR)/Yay0decompress + rm -f $(UTIL_DIR)/n64/Yay0decompress diff --git a/tools/splat/README.md b/tools/splat/README.md index c76c3d775a..434f797bcf 100644 --- a/tools/splat/README.md +++ b/tools/splat/README.md @@ -1,8 +1,10 @@ -# n64splat -A n64 rom splitting tool to assist with decompilation and modding projects +# splat +A binary splitting tool to assist with decompilation and modding projects -For example usage, see https://github.com/ethteck/papermario -The Makefile `setup` target calls n64splat with a config file that you can use for reference. More documentation coming soon. +Currently, only N64 roms in the .z64 format are supported. + +For example usage, see https://github.com/pmret/papermario +The Makefile `setup` target calls splat with a config file that you can use for reference. More documentation coming soon. ### Requirements Python package requirements can be installed via `pip3 install -r requirements.txt` diff --git a/tools/splat/create_config.py b/tools/splat/create_config.py index cb7bfbc25d..b0e10d9cfd 100755 --- a/tools/splat/create_config.py +++ b/tools/splat/create_config.py @@ -1,13 +1,11 @@ #! /usr/bin/env python3 -from capstone import * -from capstone.mips import * - import argparse -from util import rominfo +from util.n64 import rominfo +from util.n64 import find_code_length from segtypes.code import N64SegCode -parser = argparse.ArgumentParser(description="Create a splat config from a rom") +parser = argparse.ArgumentParser(description="Create a splat config from a rom (currently only n64 .z64 roms supported)") parser.add_argument("rom", help="path to a .z64 rom") @@ -25,12 +23,8 @@ options: with open(rom_path, "rb") as f: fbytes = f.read() - - rom_addr = 0x1000 - - md = Cs(CS_ARCH_MIPS, CS_MODE_MIPS64 + CS_MODE_BIG_ENDIAN) - for insn in md.disasm(fbytes[rom_addr:], rom.entry_point): - rom_addr += 4 + + first_section_end = find_code_length.run(fbytes, 0x1000, rom.entry_point) segments = \ """segments: @@ -52,7 +46,7 @@ options: - type: bin start: 0x{:X} - [0x{:X}] -""".format(rom.entry_point, rom_addr, rom.size) +""".format(rom.entry_point, first_section_end, rom.size) outstr = header + segments diff --git a/tools/splat/segtypes/Yay0.py b/tools/splat/segtypes/n64/Yay0.py similarity index 88% rename from tools/splat/segtypes/Yay0.py rename to tools/splat/segtypes/n64/Yay0.py index 7bc376fec4..3edda0a703 100644 --- a/tools/splat/segtypes/Yay0.py +++ b/tools/splat/segtypes/n64/Yay0.py @@ -1,7 +1,6 @@ import os -from segtypes.segment import N64Segment -from pathlib import Path -from util import Yay0decompress +from segtypes.n64.segment import N64Segment +from util.n64 import Yay0decompress class N64SegYay0(N64Segment): def split(self, rom_bytes, base_path): diff --git a/tools/splat/segtypes/n64/__init__.py b/tools/splat/segtypes/n64/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/splat/segtypes/bin.py b/tools/splat/segtypes/n64/bin.py similarity index 93% rename from tools/splat/segtypes/bin.py rename to tools/splat/segtypes/n64/bin.py index 92ca4eb41c..c42979b4ea 100644 --- a/tools/splat/segtypes/bin.py +++ b/tools/splat/segtypes/n64/bin.py @@ -1,5 +1,5 @@ import os -from segtypes.segment import N64Segment +from segtypes.n64.segment import N64Segment from pathlib import Path diff --git a/tools/splat/segtypes/ci4.py b/tools/splat/segtypes/n64/ci4.py similarity index 90% rename from tools/splat/segtypes/ci4.py rename to tools/splat/segtypes/n64/ci4.py index 92bb5ef69d..1632bf23b3 100644 --- a/tools/splat/segtypes/ci4.py +++ b/tools/splat/segtypes/n64/ci4.py @@ -1,4 +1,4 @@ -from segtypes.ci8 import N64SegCi8 +from segtypes.n64.ci8 import N64SegCi8 class N64SegCi4(N64SegCi8): def parse_image(self, data): diff --git a/tools/splat/segtypes/ci8.py b/tools/splat/segtypes/n64/ci8.py similarity index 94% rename from tools/splat/segtypes/ci8.py rename to tools/splat/segtypes/n64/ci8.py index 5bf2115d99..350b3611b3 100644 --- a/tools/splat/segtypes/ci8.py +++ b/tools/splat/segtypes/n64/ci8.py @@ -1,8 +1,7 @@ -from segtypes.segment import N64Segment -from segtypes.rgba16 import N64SegRgba16 +from segtypes.n64.rgba16 import N64SegRgba16 import png import os -from util import Yay0decompress +from util.n64 import Yay0decompress class N64SegCi8(N64SegRgba16): diff --git a/tools/splat/segtypes/code.py b/tools/splat/segtypes/n64/code.py similarity index 99% rename from tools/splat/segtypes/code.py rename to tools/splat/segtypes/n64/code.py index be4262a443..4b56928a43 100644 --- a/tools/splat/segtypes/code.py +++ b/tools/splat/segtypes/n64/code.py @@ -3,7 +3,7 @@ from capstone import * from capstone.mips import * from collections import OrderedDict -from segtypes.segment import N64Segment, parse_segment_name +from segtypes.n64.segment import N64Segment import os from pathlib import Path, PurePath from ranges import Range, RangeDict @@ -508,7 +508,7 @@ class N64SegCode(N64Segment): if sym_type in ["float", "double"]: if sym_type == "float": float_str = floats.format_f32_imm(bits) - elif sym_type == "double": + else: float_str = floats.format_f64_imm(bits) # Fall back to .word if we see weird float values diff --git a/tools/splat/segtypes/header.py b/tools/splat/segtypes/n64/header.py similarity index 97% rename from tools/splat/segtypes/header.py rename to tools/splat/segtypes/n64/header.py index 9a09a06962..4a4e3919a9 100644 --- a/tools/splat/segtypes/header.py +++ b/tools/splat/segtypes/n64/header.py @@ -1,7 +1,6 @@ import os -from segtypes.segment import N64Segment +from segtypes.n64.segment import N64Segment from pathlib import Path -from util import rominfo class N64SegHeader(N64Segment): def should_run(self): diff --git a/tools/splat/segtypes/i4.py b/tools/splat/segtypes/n64/i4.py similarity index 93% rename from tools/splat/segtypes/i4.py rename to tools/splat/segtypes/n64/i4.py index 0524d83e0a..092d50e867 100644 --- a/tools/splat/segtypes/i4.py +++ b/tools/splat/segtypes/n64/i4.py @@ -1,4 +1,4 @@ -from segtypes.rgba16 import N64SegRgba16 +from segtypes.n64.rgba16 import N64SegRgba16 import png from math import ceil diff --git a/tools/splat/segtypes/i8.py b/tools/splat/segtypes/n64/i8.py similarity index 84% rename from tools/splat/segtypes/i8.py rename to tools/splat/segtypes/n64/i8.py index a82741be58..a3d4abef3d 100644 --- a/tools/splat/segtypes/i8.py +++ b/tools/splat/segtypes/n64/i8.py @@ -1,4 +1,4 @@ -from segtypes.i4 import N64SegI4 +from segtypes.n64.i4 import N64SegI4 from math import ceil class N64SegI8(N64SegI4): diff --git a/tools/splat/segtypes/ia16.py b/tools/splat/segtypes/n64/ia16.py similarity index 83% rename from tools/splat/segtypes/ia16.py rename to tools/splat/segtypes/n64/ia16.py index 7d2b10ad8f..2c1025b9e3 100644 --- a/tools/splat/segtypes/ia16.py +++ b/tools/splat/segtypes/n64/ia16.py @@ -1,4 +1,4 @@ -from segtypes.ia4 import N64SegIa4 +from segtypes.n64.ia4 import N64SegIa4 class N64SegIa8(N64SegIa4): def parse_image(self, data): diff --git a/tools/splat/segtypes/ia4.py b/tools/splat/segtypes/n64/ia4.py similarity index 93% rename from tools/splat/segtypes/ia4.py rename to tools/splat/segtypes/n64/ia4.py index c2eec32bfd..909d9817be 100644 --- a/tools/splat/segtypes/ia4.py +++ b/tools/splat/segtypes/n64/ia4.py @@ -1,5 +1,4 @@ -import os -from segtypes.rgba16 import N64SegRgba16 +from segtypes.n64.rgba16 import N64SegRgba16 import png from math import ceil diff --git a/tools/splat/segtypes/ia8.py b/tools/splat/segtypes/n64/ia8.py similarity index 91% rename from tools/splat/segtypes/ia8.py rename to tools/splat/segtypes/n64/ia8.py index b4e3cbec04..e348a2463d 100644 --- a/tools/splat/segtypes/ia8.py +++ b/tools/splat/segtypes/n64/ia8.py @@ -1,5 +1,4 @@ -from segtypes.ia4 import N64SegIa4 -import png +from segtypes.n64.ia4 import N64SegIa4 from math import ceil class N64SegIa8(N64SegIa4): diff --git a/tools/splat/segtypes/palette.py b/tools/splat/segtypes/n64/palette.py similarity index 96% rename from tools/splat/segtypes/palette.py rename to tools/splat/segtypes/n64/palette.py index f20e45c199..331190188e 100644 --- a/tools/splat/segtypes/palette.py +++ b/tools/splat/segtypes/n64/palette.py @@ -1,9 +1,9 @@ import os -from segtypes.segment import N64Segment +from segtypes.n64.segment import N64Segment from util.color import unpack_color +from util.n64 import Yay0decompress from util.iter import iter_in_groups - class N64SegPalette(N64Segment): require_unique_name = False diff --git a/tools/splat/segtypes/rgba16.py b/tools/splat/segtypes/n64/rgba16.py similarity index 96% rename from tools/splat/segtypes/rgba16.py rename to tools/splat/segtypes/n64/rgba16.py index d6dbb097eb..a8d04e4713 100644 --- a/tools/splat/segtypes/rgba16.py +++ b/tools/splat/segtypes/n64/rgba16.py @@ -1,7 +1,6 @@ import os -from segtypes.segment import N64Segment -from pathlib import Path -from util import Yay0decompress +from segtypes.n64.segment import N64Segment +from util.n64 import Yay0decompress import png from math import ceil from util.color import unpack_color diff --git a/tools/splat/segtypes/rgba32.py b/tools/splat/segtypes/n64/rgba32.py similarity index 81% rename from tools/splat/segtypes/rgba32.py rename to tools/splat/segtypes/n64/rgba32.py index 009feb614e..e13c3b0811 100644 --- a/tools/splat/segtypes/rgba32.py +++ b/tools/splat/segtypes/n64/rgba32.py @@ -1,4 +1,4 @@ -from segtypes.rgba16 import N64SegRgba16 +from segtypes.n64.rgba16 import N64SegRgba16 class N64SegRgba32(N64SegRgba16): def parse_image(self, data): diff --git a/tools/splat/segtypes/n64/segment.py b/tools/splat/segtypes/n64/segment.py new file mode 100644 index 0000000000..a4d859948a --- /dev/null +++ b/tools/splat/segtypes/n64/segment.py @@ -0,0 +1,4 @@ +from segtypes.segment import Segment + +class N64Segment(Segment): + pass diff --git a/tools/splat/segtypes/segment.py b/tools/splat/segtypes/segment.py index f7cc819035..2d03dad2fe 100644 --- a/tools/splat/segtypes/segment.py +++ b/tools/splat/segtypes/segment.py @@ -1,7 +1,4 @@ -import os from pathlib import Path, PurePath -import re -import json from util import log default_subalign = 16 @@ -43,7 +40,7 @@ def parse_segment_subalign(segment): return default_subalign -class N64Segment: +class Segment: require_unique_name = True def __init__(self, segment, next_segment, options): @@ -52,8 +49,7 @@ class N64Segment: self.type = parse_segment_type(segment) self.name = parse_segment_name(segment, self.__class__) self.vram_addr = parse_segment_vram(segment) - self.ld_name_override = segment.get( - "ld_name", None) if type(segment) is dict else None + self.ld_name_override = segment.get("ld_name", None) if type(segment) is dict else None self.options = options self.config = segment self.subalign = parse_segment_subalign(segment) diff --git a/tools/splat/split.py b/tools/splat/split.py index 3c2b626fa6..93f38fa4f6 100755 --- a/tools/splat/split.py +++ b/tools/splat/split.py @@ -5,16 +5,12 @@ import importlib import importlib.util import os from ranges import Range, RangeDict -import re from pathlib import Path -import segtypes -import sys import yaml import pickle from colorama import Style, Fore -from collections import OrderedDict -from segtypes.segment import N64Segment, parse_segment_type -from segtypes.code import N64SegCode +from segtypes.segment import parse_segment_type +from segtypes.n64.code import N64SegCode from util import log parser = argparse.ArgumentParser( @@ -81,11 +77,23 @@ def parse_file_start(split_file): def get_symbol_addrs_path(repo_path, options): - return os.path.join(repo_path, options.get("symbol_addrs", "symbol_addrs.txt")) + return os.path.join(repo_path, options.get("symbol_addrs_path", "symbol_addrs.txt")) def get_undefined_syms_path(repo_path, options): - return os.path.join(repo_path, options.get("undefined_syms", "undefined_syms.txt")) + return os.path.join(repo_path, options.get("undefined_syms_path", "undefined_syms.txt")) + + +def get_undefined_syms_auto_path(repo_path, options): + return os.path.join(repo_path, options.get("undefined_syms_auto_path", "undefined_syms_auto.txt")) + + +def get_undefined_funcs_auto_path(repo_path, options): + return os.path.join(repo_path, options.get("undefined_funcs_auto_path", "undefined_funcs_auto.txt")) + + +def get_cache_path(repo_path, options): + return os.path.join(repo_path, options.get("cache_path", ".splat_cache")) def gather_symbols(symbol_addrs_path, undefined_syms_path): @@ -156,13 +164,13 @@ def gather_c_variables(undefined_syms_path): return vars -def get_base_segment_class(seg_type): +def get_base_segment_class(seg_type, platform): try: - segmodule = importlib.import_module("segtypes." + seg_type) + segmodule = importlib.import_module(f"segtypes.{platform}.{seg_type}") except ModuleNotFoundError: return None - return getattr(segmodule, "N64Seg" + seg_type[0].upper() + seg_type[1:]) + return getattr(segmodule, f"{platform.upper()}Seg{seg_type[0].upper()}{seg_type[1:]}") def get_extension_dir(options, config_path): @@ -171,20 +179,20 @@ def get_extension_dir(options, config_path): return os.path.join(Path(config_path).parent, options["extensions"]) -def get_extension_class(options, config_path, seg_type): +def get_extension_class(options, config_path, seg_type, platform): ext_dir = get_extension_dir(options, config_path) if ext_dir == None: return None try: - ext_spec = importlib.util.spec_from_file_location(f"segtypes.{seg_type}", os.path.join(ext_dir, f"{seg_type}.py")) + ext_spec = importlib.util.spec_from_file_location(f"{platform}.segtypes.{seg_type}", os.path.join(ext_dir, f"{seg_type}.py")) ext_mod = importlib.util.module_from_spec(ext_spec) ext_spec.loader.exec_module(ext_mod) except Exception as err: log.write(err, status="error") return None - return getattr(ext_mod, "N64Seg" + seg_type[0].upper() + seg_type[1:]) + return getattr(ext_mod, f"{platform.upper()}Seg{seg_type[0].upper()}{seg_type[1:]}") def fmt_size(size): @@ -196,7 +204,7 @@ def fmt_size(size): return str(size) + " B" -def initialize_segments(options, config_path, config_segments): +def initialize_segments(options, config_path, config_segments, platform): seen_segment_names = set() ret = [] @@ -207,24 +215,16 @@ def initialize_segments(options, config_path, config_segments): seg_type = parse_segment_type(segment) - segment_class = get_base_segment_class(seg_type) + segment_class = get_base_segment_class(seg_type, platform) if segment_class == None: # Look in extensions - segment_class = get_extension_class(options, config_path, seg_type) + segment_class = get_extension_class(options, config_path, seg_type, platform) if segment_class == None: log.write(f"fatal error: could not load segment type '{seg_type}'\n(hint: confirm your extension directory is configured correctly)", status="error") return 2 - try: - segment = segment_class(segment, config_segments[i + 1], options) - except (IndexError, KeyError) as e: - try: - segment = N64Segment(segment, config_segments[i + 1], options) - segment.error(e) - except Exception as e: - log.write(f"fatal error (segment type = {seg_type}): " + str(e), status="error") - return 2 + segment = segment_class(segment, config_segments[i + 1], options) if segment_class.require_unique_name: if segment.name in seen_segment_names: @@ -254,6 +254,7 @@ def main(rom_path, config_path, repo_path, modes, verbose, ignore_cache=False): symbol_addrs_path = get_symbol_addrs_path(repo_path, options) undefined_syms_path = get_undefined_syms_path(repo_path, options) provided_symbols, c_func_labels_to_add, special_labels, ranges = gather_symbols(symbol_addrs_path, undefined_syms_path) + platform = options.get("platform", "n64") processed_segments = [] ld_sections = [] @@ -267,7 +268,7 @@ def main(rom_path, config_path, repo_path, modes, verbose, ignore_cache=False): seg_cached = {} # Load cache - cache_path = Path(repo_path) / ".splat_cache" + cache_path = get_cache_path(repo_path, options) try: with open(cache_path, "rb") as f: cache = pickle.load(f) @@ -275,10 +276,10 @@ def main(rom_path, config_path, repo_path, modes, verbose, ignore_cache=False): cache = {} # Initialize segments - all_segments = initialize_segments(options, config_path, config["segments"]) + all_segments = initialize_segments(options, config_path, config["segments"], platform) for segment in all_segments: - if type(segment) == N64SegCode: + if platform == "n64" and type(segment) == N64SegCode: # remove special-case sometime segment.all_functions = defined_funcs segment.provided_symbols = provided_symbols segment.special_labels = special_labels @@ -314,7 +315,7 @@ def main(rom_path, config_path, repo_path, modes, verbose, ignore_cache=False): if len(segment.errors) == 0: processed_segments.append(segment) - if type(segment) == N64SegCode: + if platform == "n64" and type(segment) == N64SegCode: # edge case undefined_funcs |= segment.glabels_to_add defined_funcs = {**defined_funcs, **segment.glabels_added} undefined_syms |= segment.undefined_syms_to_add @@ -335,21 +336,23 @@ def main(rom_path, config_path, repo_path, modes, verbose, ignore_cache=False): write_ldscript(config['basename'], repo_path, ld_sections, options) # Write undefined_funcs_auto.txt + undefined_funcs_auto_path = get_undefined_funcs_auto_path(repo_path, options) if verbose: - log.write(f"saving undefined_funcs_auto.txt") + log.write(f"saving {undefined_funcs_auto_path}") c_predefined_funcs = set(provided_symbols.keys()) to_write = sorted(undefined_funcs - set(defined_funcs.values()) - c_predefined_funcs) if len(to_write) > 0: - with open(os.path.join(repo_path, "undefined_funcs_auto.txt"), "w", newline="\n") as f: + with open(undefined_funcs_auto_path, "w", newline="\n") as f: for line in to_write: f.write(line + " = 0x" + line.split("_")[1][:8].upper() + ";\n") # write undefined_syms_auto.txt + undefined_syms_auto_path = get_undefined_syms_auto_path(repo_path, options) if verbose: - log.write(f"saving undefined_syms_auto.txt") + log.write(f"saving {undefined_syms_auto_path}") to_write = sorted(undefined_syms, key=lambda x:x[0]) if len(to_write) > 0: - with open(os.path.join(repo_path, "undefined_syms_auto.txt"), "w", newline="\n") as f: + with open(undefined_syms_auto_path, "w", newline="\n") as f: for sym in to_write: f.write(f"{sym[0]} = 0x{sym[1]:X};\n") diff --git a/tools/splat/util/Yay0decompress.c b/tools/splat/util/n64/Yay0decompress.c similarity index 100% rename from tools/splat/util/Yay0decompress.c rename to tools/splat/util/n64/Yay0decompress.c diff --git a/tools/splat/util/Yay0decompress.py b/tools/splat/util/n64/Yay0decompress.py similarity index 100% rename from tools/splat/util/Yay0decompress.py rename to tools/splat/util/n64/Yay0decompress.py diff --git a/tools/splat/util/find_code_length.py b/tools/splat/util/n64/find_code_length.py similarity index 93% rename from tools/splat/util/find_code_length.py rename to tools/splat/util/n64/find_code_length.py index ebffe2d859..59759205d5 100755 --- a/tools/splat/util/find_code_length.py +++ b/tools/splat/util/n64/find_code_length.py @@ -4,9 +4,6 @@ from capstone import * from capstone.mips import * import argparse -import hashlib -import rominfo -import zlib md = Cs(CS_ARCH_MIPS, CS_MODE_MIPS64 + CS_MODE_BIG_ENDIAN) @@ -33,7 +30,7 @@ def run(rom_bytes, start_offset, vram, end_offset=None): def main(): args = parser.parse_args() - rom_bytes = rominfo.read_rom(args.rom) + rom_bytes = open(args.rom, "rb").read() start = int(args.start, 0) end = None vram = int(args.vram, 0) diff --git a/tools/splat/util/rominfo.py b/tools/splat/util/n64/rominfo.py similarity index 91% rename from tools/splat/util/rominfo.py rename to tools/splat/util/n64/rominfo.py index 526fcb15d3..b18aab7a6e 100755 --- a/tools/splat/util/rominfo.py +++ b/tools/splat/util/n64/rominfo.py @@ -6,7 +6,7 @@ import zlib parser = argparse.ArgumentParser(description='Gives information on n64 roms') parser.add_argument('rom', help='path to a .z64 rom') -parser.add_argument('--encoding', help='Text encoding the game header is using, defaults to ASCII, see docs.python.org/2.4/lib/standard-encodings.html for valid encodings', default='ASCII') +parser.add_argument('--encoding', help='Text encoding the game header is using; see docs.python.org/3/library/codecs.html#standard-encodings for valid encodings', default='ASCII') country_codes = { 0x37: "Beta", @@ -71,7 +71,7 @@ def get_info_bytes(rom_bytes, encoding): try: name = rom_bytes[0x20:0x34].decode(encoding).strip() except: - print("n64splat could not decode the game name, try using a different encoding by passing the --encoding argument (see docs.python.org/2.4/lib/standard-encodings.html for valid encodings)") + print("splat could not decode the game name; try using a different encoding by passing the --encoding argument (see docs.python.org/3/library/codecs.html#standard-encodings for valid encodings)") exit(1) country_code = rom_bytes[0x3E] diff --git a/tools/splat/util/n64/symbol.py b/tools/splat/util/n64/symbol.py new file mode 100644 index 0000000000..374b2ff086 --- /dev/null +++ b/tools/splat/util/n64/symbol.py @@ -0,0 +1,12 @@ +class N64Symbol: + + @staticmethod + def get_default_name(vram): + return f"D_{vram:X}" + + def __init__(self, vram, rom=None, name=None, segment=None, length=4): + self.vram = vram + self.rom = rom + self.name = name if name else self.get_default_name(vram) + self.segment = segment + self.length = length From 4141881c33fb386869a5cd512e9e19dc7f4cb683 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 25 Jan 2021 00:35:24 +0900 Subject: [PATCH 4/7] splat in configure --- configure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index b1f2b1f394..db6195c54a 100755 --- a/configure.py +++ b/configure.py @@ -159,8 +159,8 @@ async def main(): cpp = args.cpp or "cpp" ccache = "ccache" if cmd_exists("ccache") else "" - # compile n64splat dependencies - await shell("make -C tools/n64splat") + # compile splat dependencies + await shell("make -C tools/splat") # split assets print("Splitting segments from baserom", end="") From 4201a08a28b6d6f070b35f97e3ba726b5448893b Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 25 Jan 2021 00:41:31 +0900 Subject: [PATCH 5/7] git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "42786d2a7" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "42786d2a7" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" --- tools/splat/.gitrepo | 4 ++-- tools/splat/split.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/splat/.gitrepo b/tools/splat/.gitrepo index 543f264205..f024d37476 100644 --- a/tools/splat/.gitrepo +++ b/tools/splat/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/ethteck/splat.git branch = master - commit = 687885c4d8bcb86d399dbb7dcd660ad8548acdf7 - parent = dc7285954620634e352b43bcae320ba1f8dd8de7 + commit = 42786d2a77813ab4aa9e34f010f0e783a4f336d9 + parent = 4141881c33fb386869a5cd512e9e19dc7f4cb683 method = merge cmdver = 0.4.3 diff --git a/tools/splat/split.py b/tools/splat/split.py index 93f38fa4f6..902d59bbde 100755 --- a/tools/splat/split.py +++ b/tools/splat/split.py @@ -194,6 +194,8 @@ def get_extension_class(options, config_path, seg_type, platform): return getattr(ext_mod, f"{platform.upper()}Seg{seg_type[0].upper()}{seg_type[1:]}") +def get_platform(options): + return options.get("platform", "n64") def fmt_size(size): if size > 1000000: @@ -204,7 +206,7 @@ def fmt_size(size): return str(size) + " B" -def initialize_segments(options, config_path, config_segments, platform): +def initialize_segments(options, config_path, config_segments): seen_segment_names = set() ret = [] @@ -215,6 +217,8 @@ def initialize_segments(options, config_path, config_segments, platform): seg_type = parse_segment_type(segment) + platform = get_platform(options) + segment_class = get_base_segment_class(seg_type, platform) if segment_class == None: # Look in extensions @@ -254,7 +258,7 @@ def main(rom_path, config_path, repo_path, modes, verbose, ignore_cache=False): symbol_addrs_path = get_symbol_addrs_path(repo_path, options) undefined_syms_path = get_undefined_syms_path(repo_path, options) provided_symbols, c_func_labels_to_add, special_labels, ranges = gather_symbols(symbol_addrs_path, undefined_syms_path) - platform = options.get("platform", "n64") + platform = get_platform(options) processed_segments = [] ld_sections = [] From 195a99c79677702261f893556348c8c96f762112 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 25 Jan 2021 00:44:11 +0900 Subject: [PATCH 6/7] git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "e2b731ab1" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "e2b731ab1" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" --- tools/splat/.gitrepo | 4 ++-- tools/splat/split.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/splat/.gitrepo b/tools/splat/.gitrepo index f024d37476..96b0ac92e4 100644 --- a/tools/splat/.gitrepo +++ b/tools/splat/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/ethteck/splat.git branch = master - commit = 42786d2a77813ab4aa9e34f010f0e783a4f336d9 - parent = 4141881c33fb386869a5cd512e9e19dc7f4cb683 + commit = e2b731ab198c1d8400412ffd09252deca65253d2 + parent = 4201a08a28b6d6f070b35f97e3ba726b5448893b method = merge cmdver = 0.4.3 diff --git a/tools/splat/split.py b/tools/splat/split.py index 902d59bbde..57468af67f 100755 --- a/tools/splat/split.py +++ b/tools/splat/split.py @@ -280,7 +280,7 @@ def main(rom_path, config_path, repo_path, modes, verbose, ignore_cache=False): cache = {} # Initialize segments - all_segments = initialize_segments(options, config_path, config["segments"], platform) + all_segments = initialize_segments(options, config_path, config["segments"]) for segment in all_segments: if platform == "n64" and type(segment) == N64SegCode: # remove special-case sometime From c400654907f4cf0a5a960cb40f6f90d2481b9e2a Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 25 Jan 2021 00:45:29 +0900 Subject: [PATCH 7/7] updating tools --- tools/compile_npc_sprite.py | 2 +- tools/gen_sprite_animations_h.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/compile_npc_sprite.py b/tools/compile_npc_sprite.py index 39a7d96005..a171ffee0b 100755 --- a/tools/compile_npc_sprite.py +++ b/tools/compile_npc_sprite.py @@ -3,7 +3,7 @@ from sys import argv, path from pathlib import Path import os -path.append(os.path.join(os.path.dirname(__file__), "n64splat")) +path.append(os.path.join(os.path.dirname(__file__), "splat")) from splat_ext.PaperMarioNpcSprites import Sprite from convert_image import pack_color, iter_in_groups diff --git a/tools/gen_sprite_animations_h.py b/tools/gen_sprite_animations_h.py index 06568cf903..77d7f3c72b 100755 --- a/tools/gen_sprite_animations_h.py +++ b/tools/gen_sprite_animations_h.py @@ -3,7 +3,7 @@ from sys import argv, path from pathlib import Path import os -path.append(os.path.join(os.path.dirname(__file__), "n64splat")) +path.append(os.path.join(os.path.dirname(__file__), "splat")) from splat_ext.PaperMarioNpcSprites import Sprite if __name__ == "__main__":