mirror of
https://github.com/notwa/mm
synced 2025-02-05 05:23:22 -08:00
reduce build dir clutter and cwd confusion
This commit is contained in:
parent
3f1815d5a3
commit
60b55aa676
6 changed files with 31 additions and 33 deletions
1
asm/.gitignore
vendored
1
asm/.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
build
|
build
|
||||||
|
lips
|
||||||
|
|
|
@ -13,17 +13,20 @@ rom="$(readlink -f "$rom")"
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
quiet=0
|
quiet=0
|
||||||
|
|
||||||
[ ! -s "$YAZ0" ] && cc -O3 "${YAZ0}.c" -o "$YAZ0"
|
patchme="build/patchme"
|
||||||
|
|
||||||
|
#[ ! -s "$YAZ0" ] && cc -O3 "${YAZ0}.c" -o "$YAZ0"
|
||||||
|
|
||||||
dump() {
|
dump() {
|
||||||
(cd "$(dirname "$DUMP")"; ./z64dump.py "$@")
|
#(cd "$(dirname "$DUMP")"; ./z64dump.py "$@")
|
||||||
|
"$DUMP" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $fast -eq 0 ] || [ ! -d patchme ]; then
|
if [ $fast -eq 0 ] || [ ! -d "$patchme" ]; then
|
||||||
if [ -n "$sha1" ]; then
|
if [ -n "$sha1" ]; then
|
||||||
[ -d build/patchme ] && rm -r build/patchme
|
[ -d "$patchme" ] && rm -r "$patchme"
|
||||||
dump -c "$rom"
|
dump -c "$rom"
|
||||||
mv ../"$sha1" build/patchme
|
mv "$sha1" "$patchme"
|
||||||
else
|
else
|
||||||
cp "$rom" "build/$out"
|
cp "$rom" "build/$out"
|
||||||
fi
|
fi
|
||||||
|
@ -34,7 +37,7 @@ ratio() {
|
||||||
local len2="$(wc -c < "$2")"
|
local len2="$(wc -c < "$2")"
|
||||||
|
|
||||||
if [ $len1 -eq 0 ]; then
|
if [ $len1 -eq 0 ]; then
|
||||||
[ $quiet -le 0 ] && echo emptIy
|
[ $quiet -le 0 ] && echo empty
|
||||||
else
|
else
|
||||||
let percent=(len2*100)/len1
|
let percent=(len2*100)/len1
|
||||||
[ $quiet -le 0 ] && echo "ratio: $percent%"
|
[ $quiet -le 0 ] && echo "ratio: $percent%"
|
||||||
|
@ -43,19 +46,19 @@ ratio() {
|
||||||
}
|
}
|
||||||
|
|
||||||
unc() {
|
unc() {
|
||||||
local in=patchme/"$1".Yaz0
|
local in="$patchme"/"$1".Yaz0
|
||||||
local out=patchme/"$1"
|
local out="$patchme"/"$1"
|
||||||
|
|
||||||
[ -e "$in" ] || return 0
|
[ -e "$in" ] || return 0
|
||||||
"$YAZ0" "$in" > "$out"
|
"$YAZ0" "$in" > "$out"
|
||||||
[ $quiet -le 0 ] && echo "uncompressed $1"
|
[ $quiet -le 0 ] && echo "uncompressed $1"
|
||||||
ratio "$out" "$in" || true
|
ratio "$out" "$in" || true
|
||||||
rm patchme/"$1".Yaz0
|
rm "$patchme"/"$1".Yaz0
|
||||||
}
|
}
|
||||||
|
|
||||||
comp() {
|
comp() {
|
||||||
local in=patchme/"$1"
|
local in="$patchme"/"$1"
|
||||||
local out=patchme/"$1".Yaz0
|
local out="$patchme"/"$1".Yaz0
|
||||||
|
|
||||||
[ -e "$in" ] || return 0
|
[ -e "$in" ] || return 0
|
||||||
"$YAZ0" "$in" > "$out"
|
"$YAZ0" "$in" > "$out"
|
||||||
|
@ -69,14 +72,9 @@ comp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_rom() {
|
copy_rom() {
|
||||||
dd if=patchme.z64 of="$1" bs=$((1024*1024)) count="${2:-32}" status=none
|
dd if="$patchme".z64 of="$1" bs=$((1024*1024)) count="${2:-32}" status=none
|
||||||
}
|
}
|
||||||
|
|
||||||
cp *.lua build/
|
|
||||||
cp *.asm build/
|
|
||||||
#cp *.bin build/
|
|
||||||
cd build
|
|
||||||
|
|
||||||
# don't copy entire dir; avoid copying dotfiles (.git)
|
# don't copy entire dir; avoid copying dotfiles (.git)
|
||||||
mkdir -p lips
|
mkdir -p lips
|
||||||
cp "$lips"/* lips
|
cp "$lips"/* lips
|
||||||
|
|
11
asm/mm-bq
11
asm/mm-bq
|
@ -2,7 +2,6 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
sha1=d6133ace5afaa0882cf214cf88daba39e266c078
|
sha1=d6133ace5afaa0882cf214cf88daba39e266c078
|
||||||
#extracted=../dump/mm-US10-"$sha1"
|
|
||||||
rom=../../roms/everything/"Legend of Zelda, The - Majora's Mask (U) [!].z64"
|
rom=../../roms/everything/"Legend of Zelda, The - Majora's Mask (U) [!].z64"
|
||||||
out=mm-bq.z64
|
out=mm-bq.z64
|
||||||
|
|
||||||
|
@ -15,16 +14,16 @@ unc "$code"
|
||||||
|
|
||||||
dd if=/dev/zero of=extra bs=370688 count=1 2>/dev/null
|
dd if=/dev/zero of=extra bs=370688 count=1 2>/dev/null
|
||||||
|
|
||||||
luajit patch.lua -e labels.lua -b 0x80780000 "$@" extra.asm extra
|
luajit patch.lua -e build/labels.lua -b 0x80780000 "$@" extra.asm extra
|
||||||
luajit patch.lua -i labels.lua "$@" code.asm patchme/"$code"
|
luajit patch.lua -i build/labels.lua "$@" code.asm build/patchme/"$code"
|
||||||
|
|
||||||
# ensure the file is the proper size (Lua seems to expand it?)
|
# ensure the file is the proper size (Lua seems to expand it?)
|
||||||
dd if=extra of=patchme/"$extra" bs=370688 count=1 2>/dev/null
|
dd if=extra of=build/patchme/"$extra" bs=370688 count=1 2>/dev/null
|
||||||
rm extra
|
rm extra
|
||||||
|
|
||||||
if [ $fast -ne 2 ]; then
|
if [ $fast -ne 2 ]; then
|
||||||
comp "$code"
|
comp "$code"
|
||||||
comp "$extra"
|
comp "$extra"
|
||||||
dump asm/build/patchme
|
dump "$patchme"
|
||||||
copy_rom "$out" 32
|
copy_rom "build/$out" 32
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -46,8 +46,8 @@ for f in \
|
||||||
"1516 V035B3000 test01_scene" \
|
"1516 V035B3000 test01_scene" \
|
||||||
"1517 V035B7000 test01_room_0" \
|
"1517 V035B7000 test01_room_0" \
|
||||||
; do
|
; do
|
||||||
rm patchme/"$f"
|
rm "$patchme"/"$f"
|
||||||
touch patchme/"$f"
|
touch "$patchme"/"$f"
|
||||||
echo "deleted $f"
|
echo "deleted $f"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -63,8 +63,8 @@ for f in \
|
||||||
"0985 V01E26000 vr_IPVR_static" \
|
"0985 V01E26000 vr_IPVR_static" \
|
||||||
"0999 V01F2D000 vr_LBVR_static" \
|
"0999 V01F2D000 vr_LBVR_static" \
|
||||||
; do
|
; do
|
||||||
rm patchme/"$f"
|
rm "$patchme"/"$f"
|
||||||
touch patchme/"$f"
|
touch "$patchme"/"$f"
|
||||||
echo "deleted $f"
|
echo "deleted $f"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ if [ $fast -ne 2 ]; then
|
||||||
# comp "$title"
|
# comp "$title"
|
||||||
# z64dump.py doesn't have compression support rn
|
# z64dump.py doesn't have compression support rn
|
||||||
# so we'll do this ourselves
|
# so we'll do this ourselves
|
||||||
for f in patchme/*; do
|
for f in "$patchme"/*; do
|
||||||
ext="${f##*.}" # warning: not robust
|
ext="${f##*.}" # warning: not robust
|
||||||
dirless="${f##*/}" # warning: not robust
|
dirless="${f##*/}" # warning: not robust
|
||||||
n="${dirless:0:4}"
|
n="${dirless:0:4}"
|
||||||
|
@ -325,6 +325,6 @@ if [ $fast -ne 2 ]; then
|
||||||
quiet=0
|
quiet=0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
dump asm/build/patchme
|
dump "$patchme"
|
||||||
copy_rom "$out" 32
|
copy_rom "$out" 32
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -9,6 +9,6 @@ out=oot-spawner.z64
|
||||||
|
|
||||||
luajit patch.lua \
|
luajit patch.lua \
|
||||||
-O 0x035D0000 -b $((0x80700000 - 0x035D0000)) \
|
-O 0x035D0000 -b $((0x80700000 - 0x035D0000)) \
|
||||||
'spawn O EUDB MQ.asm' "$out"
|
'spawn O EUDB MQ.asm' "build/$out"
|
||||||
|
|
||||||
dump -f asm/build/"$out"
|
dump -f "build/$out"
|
||||||
|
|
|
@ -9,6 +9,6 @@ out=oot-widescreen.z64
|
||||||
|
|
||||||
luajit patch.lua \
|
luajit patch.lua \
|
||||||
-O 0x035D0000 -b $((0x80700000 - 0x035D0000)) \
|
-O 0x035D0000 -b $((0x80700000 - 0x035D0000)) \
|
||||||
widescreen-inline-rom.asm "$out"
|
widescreen-inline-rom.asm "build/$out"
|
||||||
|
|
||||||
dump -f asm/build/"$out"
|
dump -f "build/$out"
|
||||||
|
|
Loading…
Add table
Reference in a new issue