-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmake.sh
More file actions
executable file
·85 lines (84 loc) · 3.45 KB
/
make.sh
File metadata and controls
executable file
·85 lines (84 loc) · 3.45 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! /bin/bash
#-------------------------------------------------------------
# Create the 'Fixed PSI Animations' patch for the Base ROM
#coilsnake-cli createpatch "EarthBound.sfc" "EarthBound (Expanded).sfc" "FixedPSIAnims.ebp" ShadowOne333 "Clean up PSI Animations from garbage pixels/tiles" "PSI Animations Fixes" && \
#-------------------------------------------------------------
TIME=$(date +'%T, %a %d/%b/%Y')
SECS=$(date +%s)
CLEAN_ROM="EarthBound.sfc"
BASE="PSIAnimsBase.sfc"
CHECKSUM="d67a8ef36ef616bc39306aa1b486e1bd3047815a"
#-------------------------------------------------------------
# Error message function
Error()
{
echo; echo "Redux compilation exited with errors!"
echo "ERROR: $error"
}
#-------------------------------------------------------------
# Script end function
End()
{
sleep 1
exit
}
#-------------------------------------------------------------
# Check base ROM name to be "EarthBound.sfc"
if [ -e EarthBound.sfc ]; then
echo "ROM detected. Verifying name..."
else
export error="Incorrect ROM name."
Error;
echo "Please, rename the ROM to 'EarthBound.sfc' to begin the patching process."
End;
fi
#-------------------------------------------------------------
# SHA-1 sum verification
if [ -f "$CLEAN_ROM" ]; then
echo; echo "Base ROM detected with proper name."
echo "Verifying SHA-1 checksum hash..."
else
export error="Base ROM not found."
Error;
echo "Place the 'EarthBound.sfc' ROM inside this directory."
End;
fi
export SHA1=$(sha1sum "$CLEAN_ROM" | awk '{ print $1 }')
#-------------------------------------------------------------
# SHA-1 sum verified, begin patching...
if [ "$SHA1" == "$CHECKSUM" ]; then
echo; echo "Base ROM SHA-1 checksum verified."
echo "Starting patching process..."; echo;
else
export error="Base ROM checksum is incorrect."
Error;
echo "Use an EarthBound ROM with the proper SHA-1 checksum for patching."
End;
fi
#-------------------------------------------------------------
# Patch the Base ROM with the Expanded PSI Animations
if [ -f $BASE ]; then
echo "$BASE exists, proceeding with compilation..."
else
echo "Base ROM ($BASE) not found, creating it..."
coilsnake-cli patchrom EarthBound.sfc $BASE "Patches/FixedPSIAnims.ebp" false
coilsnake-cli expand $BASE false
fi
#-------------------------------------------------------------
# Compile the full CoilSnake Project for MaternalBound Redux (--ccscriptoffset=F10000)
echo && coilsnake-cli compile Project/ $BASE "Mother 2.sfc" && \
#-------------------------------------------------------------
# Create the EBP patch based on the Project
echo && coilsnake-cli createpatch EarthBound.sfc "Mother 2.sfc" "Patches/MaternalBound-Redux.ebp" "ShadowOne333" "A new MaternalBound with New Controls, MSU-1 integration and much more!" "MaternalBound Redux" && \
#-------------------------------------------------------------
# Create both additional BPS and IPS patches files (IPS removed for compatibility)
echo && echo "Creating both BPS patch..." && \
./flips -c EarthBound.sfc "Mother 2.sfc" "Patches/MaternalBound-Redux.bps" && \
#./flips -c EarthBound.sfc "Mother 2.sfc" "Patches/MaternalBound-Redux.ips" && \
echo "BPS patch created successfully!"
#-------------------------------------------------------------
# Finish script and jump to the "End" function
echo; echo "Final compilation time: $(( $(date +%s) - SECS )) seconds"
echo "Redux compilation finished at $TIME!"
End;
#-------------------------------------------------------------