diff --git a/.gitignore b/.gitignore index 1b91f113..67f29a61 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ dump/* *.ctx ctx.* !tools/orthrus.exe +!tools/sjiswrap.exe build.ninja ac-decomp.code-workspace assets/ diff --git a/common.py b/common.py index bdd6122f..0554d158 100644 --- a/common.py +++ b/common.py @@ -215,11 +215,10 @@ CC = os.path.join(CODEWARRIOR, "mwcceppc.exe") CC_R = os.path.join(CODEWARRIOR_RODATA_POOL_FIX, "mwcceppc.exe") OCC = os.path.join(SDK_CW, "mwcceppc.exe") LD = os.path.join(CODEWARRIOR, "mwldeppc.exe") +SJISWRAP = f"{TOOLS}/sjiswrap.exe" if platform != "win32": - CC = f"wibo {CC}" - CC_R = f"wibo {CC_R}" - OCC = f"wibo {OCC}" LD = f"wibo {LD}" + SJISWRAP = f"wibo {SJISWRAP}" else: ORTHRUS = os.path.join(TOOLS, "orthrus.exe") @@ -236,8 +235,6 @@ PAL16DIS = f"{PYTHON} {TOOLS}/converters/pal16dis.py" # JSystem JKernel archive tool ARC_TOOL = f"{PYTHON} {TOOLS}/arc_tool.py" -ICONV = f"{PYTHON} tools/sjis.py" # TODO: get actual iconv working(?) - # N64 SDK path for GBI N64SDK = os.environ.get("N64_SDK") assert N64SDK != None, "N64_SDK is not defined as a system environment variable" diff --git a/configure.py b/configure.py index 926f7b12..c56be844 100644 --- a/configure.py +++ b/configure.py @@ -97,11 +97,11 @@ n.variable("ld", c.LD) n.variable("devkitppc", c.DEVKITPPC) n.variable("as", c.AS) n.variable("cpp", c.CPP) -n.variable("iconv", c.ICONV) n.variable("forcefilesgen", c.FORCEFILESGEN) n.variable("vtxdis", c.VTXDIS) n.variable("pal16dis", c.PAL16DIS) n.variable("arctool", c.ARC_TOOL) +n.variable("sjiswrap", c.SJISWRAP) n.newline() ############## @@ -121,7 +121,7 @@ n.newline() # Windows can't use && without this statement ALLOW_CHAIN = "cmd /c " if os.name == "nt" else "" -mwcc_cmd = ALLOW_CHAIN + f"$cpp -M $in -MF $out.d $cppflags && $cc $cflags -c $in -o $out" +mwcc_cmd = ALLOW_CHAIN + f"$cpp -M $in -MF $out.d $cppflags && $sjiswrap $cc $cflags -c $in -o $out" n.rule( "relextern", @@ -225,7 +225,7 @@ n.rule( n.rule( "ccs", - command = ALLOW_CHAIN + f"$cpp -M $in -MF $out.d $cppflags && $cc $cflags -S $in -o $out", + command = ALLOW_CHAIN + f"$cpp -M $in -MF $out.d $cppflags && $sjiswrap $cc $cflags -S $in -o $out", description = "CC -S $in", deps = "gcc", depfile = "$out.d" @@ -237,12 +237,6 @@ n.rule( description = "LD $out", ) -n.rule( - "iconv", - command = "$iconv $in $out", - description = "iconv $in", -) - n.rule( "forcefiles", command = "$forcefilesgen $in $out $forcefiles", @@ -267,6 +261,12 @@ n.rule( description = "$arctool -v $in $out" ) +n.rule( + "sjiswrap", + command = "$sjiswrap $in", + description = "sjiswrap $in", +) + ########## # Assets # ########## @@ -676,7 +676,6 @@ class CSource(Source): else: self.cflags = ctx.cflags self.cc = c.CC_R - self.iconv_path = f"$builddir/iconv/{path}" # Find generated includes with open(path, encoding="utf-8") as f: @@ -686,16 +685,10 @@ class CSource(Source): super().__init__(True, path, f"$builddir/{os.path.splitext(path)[0]}.o", gen_includes) def build(self): - n.build( - self.iconv_path, - rule="iconv", - inputs=self.src_path - ) - n.build( self.o_path, rule = "cc", - inputs = self.iconv_path, + inputs = self.src_path, implicit = [inc.path for inc in self.gen_includes], variables = { "cc" : self.cc, @@ -707,7 +700,7 @@ class CSource(Source): n.build( self.s_path, rule = "ccs", - inputs = self.iconv_path, + inputs = self.src_path, implicit = [inc.path for inc in self.gen_includes], variables = { "cflags" : self.cflags diff --git a/docs/extract_game.md b/docs/extract_game.md index 7befff7c..b7e6e645 100644 --- a/docs/extract_game.md +++ b/docs/extract_game.md @@ -40,12 +40,6 @@ Once files have been extracted you will need to copy the following files into th Make sure to rename `main.dol` to `static.dol`. -You will also need to decompress `foresta.rel.szs` using `yaz0` found in `tools/` using the following command: - -~~~~console -yaz0 -d foresta.rel.szs foresta.rel -~~~~ - It is recommended that you also copy the following symbol maps for reference: - `foresta.map` - `static.map` \ No newline at end of file diff --git a/tools/sjiswrap.exe b/tools/sjiswrap.exe new file mode 100644 index 00000000..4ddb9069 Binary files /dev/null and b/tools/sjiswrap.exe differ