1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-11-05 02:19:03 -08:00
mm/patch/mm-bq

30 lines
707 B
Bash
Executable file

#!/usr/bin/env bash
set -e
sha1=d6133ace5afaa0882cf214cf88daba39e266c078
#extracted=../dump/mm-US10-"$sha1"
rom=../../roms/everything/"Legend of Zelda, The - Majora's Mask (U) [!].z64"
out=mm-bq.z64
. common.sh
code="0031 V00B3C000"
extra="1552 V02EE7040"
unc "$code"
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 -i labels.lua "$@" code.asm patchme/"$code"
# 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
rm extra
if [ $fast -ne 2 ]; then
comp "$code"
comp "$extra"
dump patch/build/patchme
copy_rom "$out" 32
fi