2016-04-02 02:06:46 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
sha1=d6133ace5afaa0882cf214cf88daba39e266c078
|
2016-04-26 15:28:58 -07:00
|
|
|
rom=../../roms/everything/"Legend of Zelda, The - Majora's Mask (U) [!].z64"
|
2016-04-15 11:43:38 -07:00
|
|
|
out=mm-bq.z64
|
2016-04-02 05:58:46 -07:00
|
|
|
|
2016-04-26 15:28:58 -07:00
|
|
|
. common.sh
|
|
|
|
|
2016-04-02 02:06:46 -07:00
|
|
|
code="0031 V00B3C000"
|
2016-04-02 05:58:46 -07:00
|
|
|
extra="1552 V02EE7040"
|
2016-04-02 02:06:46 -07:00
|
|
|
|
2016-04-04 07:39:46 -07:00
|
|
|
unc "$code"
|
2016-04-02 02:06:46 -07:00
|
|
|
|
2016-04-10 07:00:10 -07:00
|
|
|
dd if=/dev/zero of=extra bs=370688 count=1 2>/dev/null
|
2016-04-02 05:58:46 -07:00
|
|
|
|
2016-10-03 15:21:43 -07:00
|
|
|
luajit patch.lua -e build/labels.lua -b 0x80780000 "$@" extra.asm extra
|
|
|
|
luajit patch.lua -i build/labels.lua "$@" code.asm build/patchme/"$code"
|
2016-04-04 07:39:46 -07:00
|
|
|
|
2016-04-10 07:00:10 -07:00
|
|
|
# ensure the file is the proper size (Lua seems to expand it?)
|
2016-10-03 15:21:43 -07:00
|
|
|
dd if=extra of=build/patchme/"$extra" bs=370688 count=1 2>/dev/null
|
2016-04-04 07:39:46 -07:00
|
|
|
rm extra
|
2016-04-02 05:58:46 -07:00
|
|
|
|
|
|
|
if [ $fast -ne 2 ]; then
|
2016-04-04 07:39:46 -07:00
|
|
|
comp "$code"
|
|
|
|
comp "$extra"
|
2016-10-03 15:21:43 -07:00
|
|
|
dump "$patchme"
|
|
|
|
copy_rom "build/$out" 32
|
2016-04-02 05:58:46 -07:00
|
|
|
fi
|