mirror of
https://github.com/HackerN64/HackerOoT.git
synced 2026-01-21 10:37:37 -08:00
* git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "b3bfa14cf" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "b3bfa14cf" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb" * use CS_FLOAT * update csdis * update committed csdata * finish updating csdis.py * add script to reextract committed csdata * dont use asm-processor, use iconv for reencoding utf8 to eucjp * remove asm-processor csdata usage remnants * --cs-float hex * delete tempfile at end of reencode.sh (may want to rm even if compilation fails though?) * comment reencode.sh * comment CMD_F * do not break permuter guessing compile command, by not reencode.sh-wrapping compilation under PERMUTER (thanks anghelo) * fix the permuter fix * pad -> sBssDummyNeg1 * reencode.sh: rm tempfile on script exit (including on error) * renumber sBssDummy vars in zcolchk from 0 * Revert "--cs-float hex" This reverts commit 85267dc348741b67ac9c12eb60e1e764793d0bb6. * Revert BSS changes * Add linemarker to reencoded files for better error message * fix audio/general.c bss * make reencode.sh work on macOS * touch up csdis, csdis_re --------- Co-authored-by: cadmic <cadmic24@gmail.com>
27 lines
1022 B
Bash
Executable File
27 lines
1022 B
Bash
Executable File
#!/bin/bash
|
|
# The repo uses UTF-8 for text encoding, but the strings in the ROM are encoded in EUC-JP.
|
|
# This means for matching the source must be re-encoded to EUC-JP before IDO compiles it.
|
|
# This is conceptually equivalent to `gcc --finput-charset=UTF-8 --fexec-charset=EUC-JP`,
|
|
# except IDO has no equivalent arguments.
|
|
# Usage: reencode.sh [compile command minus input file...] [single input file]
|
|
|
|
set -e
|
|
|
|
# The last argument, the input source file to be compiled
|
|
srcfile="${@: -1}"
|
|
|
|
# Create a temporary file, and remove it on script exit
|
|
tempfile=`mktemp`_oot.c
|
|
trap "rm -f $tempfile" EXIT
|
|
|
|
# Re-encode from UTF-8 to EUC-JP
|
|
{
|
|
printf '#line 1 "%s"\n' "$srcfile" # linemarker
|
|
cat "$srcfile"
|
|
} | iconv -f UTF-8 -t EUC-JP > "$tempfile"
|
|
|
|
# All arguments but the last, forming the compile command
|
|
# Also include the source file's directory to have the include path as if we compiled the original source.
|
|
# Pass the EUC-JP encoded temporary file for compilation.
|
|
"${@:1:$# - 1}" -I `dirname $srcfile` $tempfile
|