-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sh
executable file
·39 lines (31 loc) · 1.01 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
rom=${1:-"rom/input.gba"}
out_rom=${2:-"rom/output.gba"}
diff=${3:-"rom/patch.diff"}
# Checks that the rom is the correct one.
if [ ! -w "$rom" ] ; then
echo "ROM is not present or is not writable"
exit 1
else
is_fzero_climax_jp=$(strings $rom | grep F-ZEROCLIMAXBFTJ01)
if [ $is_fzero_climax_jp = "" ] ; then
echo "ROM is not F-ZERO Climax"
exit 1
fi
fi
# Checks that the armips assembler is in the path.
armips=$(which armips)
if [ ! -x "$armips" ] ; then
echo "ARMIPS compiler is missing, please install it and add it to your PATH."
exit 1
fi
# Cleanup the output rom.
rm $out_rom
# Copy given gba file into the output rom read by the .asm files.
cp $rom $out_rom
# TODO : List all assembly files into something and loop on it.
armips -erroronwarning asm/misc.asm
armips -erroronwarning asm/variableWidthFont.asm
armips -erroronwarning asm/script/story/story.asm
armips -erroronwarning asm/script/profiles/profiles.asm
# Generate a diff that can be applied to an existing ROM.
bsdiff $rom $out_rom $diff