hell yeah new binary patcher thing and a license
This commit is contained in:
parent
d4e9baada6
commit
3fd0ce9ffe
22 changed files with 198 additions and 101 deletions
|
|
@ -1,7 +1,10 @@
|
||||||
WORKDIR="/tmp/wacca"
|
WORKDIR="/tmp/wacca"
|
||||||
MOUNT_AS_ROOT=true
|
MOUNT_AS_ROOT=true
|
||||||
|
MANGOHUD_ENABLE=false
|
||||||
|
AIRGAP=false # Disable downloading game requirements and expect them to be present offline
|
||||||
|
ENABLE_CUSTOM_CHARTS=false # Enable injecting custom charts from customcharts folder
|
||||||
# VERSION
|
# VERSION
|
||||||
VERSION=""
|
VERSION="3.07.01"
|
||||||
# NETWORKING
|
# NETWORKING
|
||||||
NET_KEYCHIP_ID=""
|
NET_KEYCHIP_ID=""
|
||||||
NET_HOSTNAME=""
|
NET_HOSTNAME=""
|
||||||
|
|
@ -14,5 +17,5 @@ PORT_AIME_READER=""
|
||||||
BINPATCH_DISABLE_LOCKOUT=0 # Fully disable lockout
|
BINPATCH_DISABLE_LOCKOUT=0 # Fully disable lockout
|
||||||
BINPATCH_FORCE_ENGINE_LOCALE=0 # Force Engine locale (ignore router country language)
|
BINPATCH_FORCE_ENGINE_LOCALE=0 # Force Engine locale (ignore router country language)
|
||||||
BINPATCH_ALLOW_CHN_REGION=0 # Allow using CHN region (don't change to HKG)
|
BINPATCH_ALLOW_CHN_REGION=0 # Allow using CHN region (don't change to HKG)
|
||||||
BINPATCH_FORCE_HIDDEN_LUIN_TITLE=1 # Force enable Hidden Luin title screen
|
BINPATCH_FORCE_HIDDEN_LUIN_TITLE=0 # Force enable Hidden Luin title screen
|
||||||
ENABLE_EN_US_TRANSLATION=1
|
ENABLE_EN_US_TRANSLATION=1
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,4 +1,5 @@
|
||||||
images/*
|
images/*
|
||||||
imagestore/app/*.app
|
imagestore/app/*.app
|
||||||
imagestore/vhd/*.vhd
|
imagestore/vhd/*.vhd
|
||||||
|
customcharts/*
|
||||||
.config
|
.config
|
||||||
6
LICENSE
Normal file
6
LICENSE
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
POTION SELLER PUBLIC LICENSE
|
||||||
|
Copyright (c) 2025 BlackDragon
|
||||||
|
|
||||||
|
THIS SOFTWARE IS TOO STRONG FOR YOU, USER. YOU CAN'T HANDLE MY SOFTWARE. IT'S TOO STRONG FOR YOU. MY STRONGEST SOFTWARE WOULD KILL YOU, USER. YOU CAN'T HANDLE MY STRONGEST SOFTWARE. YOU'D BETTER GO TO A DEVELOPER WHO WRITES WEAKER SOFTWARE. YOU DON'T KNOW WHAT YOU ASK, USER. MY STRONGEST SOFTWARE WOULD KILL A SYSTEMS PROGRAMMER, LET ALONE A MAN. YOU NEED A DEVELOPER WHO WRITES WEAKER SOFTWARE, BECAUSE MY SOFTWARE IS TOO STRONG. YOU CAN'T HANDLE MY STRONGEST SOFTWARE. NO ONE CAN. I CAN'T GIVE YOU MY STRONGEST SOFTWARE, BECAUSE MY STRONGEST SOFTWARE IS ONLY FOR THE STRONGEST BEINGS, AND YOU ARE OF THE WEAKEST.
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial potions of the Software.
|
||||||
46
configure.sh
46
configure.sh
|
|
@ -1,46 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
|
|
||||||
selectversion() {
|
|
||||||
versions=()
|
|
||||||
count=0
|
|
||||||
for profile_dir in profiles/*/; do
|
|
||||||
# Remove the trailing slash to get clean directory name
|
|
||||||
count=$[count+1]
|
|
||||||
echo $profile_dir
|
|
||||||
source $profile_dir/metadata
|
|
||||||
echo $prettyname
|
|
||||||
versions+=("$version" "$prettyname")
|
|
||||||
done
|
|
||||||
exec 3>&1;
|
|
||||||
sel=$(dialog --menu "Select major version" 20 60 10 "${versions[@]}" 2>&1 1>&3)
|
|
||||||
for profile_dir in profiles/*/; do
|
|
||||||
source $profile_dir/metadata
|
|
||||||
if [[ "$sel" == "$version" ]]; then
|
|
||||||
profile=$(basename $profile_dir)
|
|
||||||
versions2=()
|
|
||||||
count=0
|
|
||||||
while IFS=, read -r vhd version identifier backingversion parent_identifier parent_filename
|
|
||||||
do
|
|
||||||
echo $vhd
|
|
||||||
count=$[count+1]
|
|
||||||
versions2+=("$version" "$vhd")
|
|
||||||
done < images/lookup/phase1_$profile.csv
|
|
||||||
exec 3>&1;
|
|
||||||
sel=$(dialog --menu "Select an item:" 20 60 10 "${versions2[@]}" 2>&1 1>&3)
|
|
||||||
sed -i "s/VERSION=.*/VERSION=\"$sel\"/" .config
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
setserver() {
|
|
||||||
source .config
|
|
||||||
exec 3>&1;
|
|
||||||
|
|
||||||
hostname=$(dialog --title "Network" --inputbox "Server Hostname" 10 30 "${NET_HOSTNAME:-}" 2>&1 1>&3)
|
|
||||||
keychip=$(dialog --inputbox "Modify keychip id" 10 30 "${NET_KEYCHIP_ID:-A$(printf "%02d" $((RANDOM % 100)))$(shuf -e E X | head -n1)-$(shuf -e 01 20 | head -n1)$(shuf -e A B C D U | head -n1)$(tr -dc 0-9 </dev/urandom | head -c 8)}" 2>&1 1>&3)
|
|
||||||
sed -i "s/NET_HOSTNAME=.*/NET_HOSTNAME=\"$hostname\"/" .config
|
|
||||||
sed -i "s/NET_KEYCHIP_ID=.*/NET_KEYCHIP_ID=\"$keychip\"/" .config
|
|
||||||
}
|
|
||||||
setserver
|
|
||||||
# selectversion
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
1.00.00,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.00_20190703184305_0.app,
|
1.00.00,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.00_20190703184305_0.app
|
||||||
1.00.01,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.01_20190726165725_1_1.00.00.app,
|
1.00.01,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.01_20190726165725_1_1.00.00.app
|
||||||
1.00.02,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.02_20190828145748_2_1.00.01.app,
|
1.00.02,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.02_20190828145748_2_1.00.01.app
|
||||||
1.00.03,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.03_20190925193020_3_1.00.02.app,
|
1.00.03,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.03_20190925193020_3_1.00.02.app
|
||||||
1.00.04,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.04_20191023154049_4_1.00.03.app,
|
1.00.04,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.04_20191023154049_4_1.00.03.app
|
||||||
1.00.05,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.06_20191217194809_6_1.00.05.app,
|
1.00.05,https://ia600509.us.archive.org/8/items/WACCA/JPN/SDFE_1.00.06_20191217194809_6_1.00.05.app
|
||||||
1.50.00,https://archive.org/download/WACCA/EXP/1.50.00%20USB/SDFE_1.50.00_20191225123843_0.app,S #CORRUPT
|
1.50.00,https://archive.org/download/WACCA/EXP/1.50.00%20USB/SDFE_1.50.00_20191225123843_0.app
|
||||||
1.50.01,https://archive.org/download/WACCA/EXP/SDFE_1.50.01_20200130145033_1_1.50.00.app,S
|
1.50.01,https://archive.org/download/WACCA/EXP/SDFE_1.50.01_20200130145033_1_1.50.00.app
|
||||||
1.50.02,https://archive.org/download/WACCA/EXP/SDFE_1.50.02_20200227161144_2_1.50.01.app,S
|
1.50.02,https://archive.org/download/WACCA/EXP/SDFE_1.50.02_20200227161144_2_1.50.01.app
|
||||||
1.50.03,https://archive.org/download/WACCA/EXP/SDFE_1.50.03_20200316131604_3_1.50.02.app,S
|
1.50.03,https://archive.org/download/WACCA/EXP/SDFE_1.50.03_20200316131604_3_1.50.02.app
|
||||||
1.50.04,https://archive.org/download/WACCA/EXP/SDFE_1.50.04_20200325170234_4_1.50.03.app,S
|
1.50.04,https://archive.org/download/WACCA/EXP/SDFE_1.50.04_20200325170234_4_1.50.03.app
|
||||||
1.50.05,https://archive.org/download/WACCA/EXP/SDFE_1.50.05_20200608155410_5_1.50.04.app,S
|
1.50.05,https://archive.org/download/WACCA/EXP/SDFE_1.50.05_20200608155410_5_1.50.04.app
|
||||||
1.50.06,https://archive.org/download/WACCA/EXP/SDFE_1.50.06_20200722145703_6_1.50.05.app,S
|
1.50.06,https://archive.org/download/WACCA/EXP/SDFE_1.50.06_20200722145703_6_1.50.05.app
|
||||||
2.00.00,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app,Lily
|
2.00.00,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app
|
||||||
2.01.00,https://archive.org/download/WACCA/EXP/SDFE_2.01.00_20200923205643_1_2.00.00.app,Lily
|
2.01.00,https://archive.org/download/WACCA/EXP/SDFE_2.01.00_20200923205643_1_2.00.00.app
|
||||||
2.02.00,https://archive.org/download/WACCA/EXP/SDFE_2.02.00_20201030154849_2_2.01.00.app,Lily
|
2.02.00,https://archive.org/download/WACCA/EXP/SDFE_2.02.00_20201030154849_2_2.01.00.app
|
||||||
2.03.00,https://archive.org/download/WACCA/EXP/SDFE_2.03.00_20201130071007_3_2.02.00.app,Lily
|
2.03.00,https://archive.org/download/WACCA/EXP/SDFE_2.03.00_20201130071007_3_2.02.00.app
|
||||||
2.04.00,https://archive.org/download/WACCA/EXP/SDFE_2.04.00_20210114100544_4_2.03.00.app,Lily
|
2.04.00,https://archive.org/download/WACCA/EXP/SDFE_2.04.00_20210114100544_4_2.03.00.app
|
||||||
2.5x.xx,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app,Lily R
|
2.5x.xx,https://archive.org/download/WACCA/EXP/2.00.00%20USB/SDFE_2.00.00_20200813163739_0.app
|
||||||
2.50.00,https://archive.org/download/WACCA/EXP/SDFE_2.50.00_20210129180947_1_2.00.00.app,Lily R
|
2.50.00,https://archive.org/download/WACCA/EXP/SDFE_2.50.00_20210129180947_1_2.00.00.app
|
||||||
2.51.00,https://archive.org/download/WACCA/EXP/SDFE_2.51.00_20210309120850_2_2.50.00.app,Lily R
|
2.51.00,https://archive.org/download/WACCA/EXP/SDFE_2.51.00_20210309120850_2_2.50.00.app
|
||||||
2.52.00,https://archive.org/download/WACCA/EXP/SDFE_2.52.00_20210426101902_2_2.50.00.app,Lily R
|
2.52.00,https://archive.org/download/WACCA/EXP/SDFE_2.52.00_20210426101902_2_2.50.00.app
|
||||||
2.53.00,https://archive.org/download/WACCA/EXP/SDFE_2.53.00_20210607052915_3_2.52.00.app,Lily R
|
2.53.00,https://archive.org/download/WACCA/EXP/SDFE_2.53.00_20210607052915_3_2.52.00.app
|
||||||
3.00.00,https://archive.org/download/WACCA/EXP/3.00.00%20USB/SDFE_3.00.00_20210701023921_0.app,Reverse
|
3.00.00,https://archive.org/download/WACCA/EXP/3.00.00%20USB/SDFE_3.00.00_20210701023921_0.app
|
||||||
3.01.00,https://archive.org/download/WACCA/EXP/SDFE_3.01.00_20210817052556_1_3.00.00.app,Reverse
|
3.01.00,https://archive.org/download/WACCA/EXP/SDFE_3.01.00_20210817052556_1_3.00.00.app
|
||||||
3.02.00,https://archive.org/download/WACCA/EXP/SDFE_3.02.00_20210927052723_2_3.01.00.app,Reverse
|
3.02.00,https://archive.org/download/WACCA/EXP/SDFE_3.02.00_20210927052723_2_3.01.00.app
|
||||||
3.03.00,https://archive.org/download/WACCA/EXP/SDFE_3.03.00_20211112063023_3_3.02.00.app,Reverse
|
3.03.00,https://archive.org/download/WACCA/EXP/SDFE_3.03.00_20211112063023_3_3.02.00.app
|
||||||
3.04.00,https://archive.org/download/WACCA/EXP/SDFE_3.04.00_20211208062838_4_3.03.00.app,Reverse
|
3.04.00,https://archive.org/download/WACCA/EXP/SDFE_3.04.00_20211208062838_4_3.03.00.app
|
||||||
3.05.00,https://archive.org/download/WACCA/EXP/SDFE_3.05.00_20220203063543_5_3.04.00.app,Reverse
|
3.05.00,https://archive.org/download/WACCA/EXP/SDFE_3.05.00_20220203063543_5_3.04.00.app
|
||||||
3.06.00,https://archive.org/download/WACCA/EXP/SDFE_3.06.00_20220412064126_6_3.05.00.app,Reverse
|
3.06.00,https://archive.org/download/WACCA/EXP/SDFE_3.06.00_20220412064126_6_3.05.00.app
|
||||||
3.07.00,https://archive.org/download/WACCA/EXP/SDFE_3.07.00_20220609093125_7_3.06.00.app,Reverse
|
3.07.00,https://archive.org/download/WACCA/EXP/SDFE_3.07.00_20220609093125_7_3.06.00.app
|
||||||
3.07.01,https://archive.org/download/WACCA/EXP/SDFE_3.07.01_20220628165934_8_3.07.00.app,Reverse
|
3.07.01,https://archive.org/download/WACCA/EXP/SDFE_3.07.01_20220628165934_8_3.07.00.app
|
||||||
3.10.00,https://archive.org/downloadWACCA/SDFE_3.10.00/SDFE_3.10.00_20220630054729_0.app,Reverse
|
3.10.00,https://archive.org/download/WACCA/SDFE_3.10.00/SDFE_3.10.00_20220630054729_0.app
|
||||||
|
77
init.sh
77
init.sh
|
|
@ -1,11 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
source .config
|
source .config
|
||||||
|
|
||||||
workdir=${WORKDIR:-/tmp/wacca}
|
workdir=${WORKDIR:-/tmp/wacca}
|
||||||
version=${VERSION:-3.07.01}
|
version=${VERSION:-3.07.01}
|
||||||
|
airgap=${AIRGAP:-false}
|
||||||
|
|
||||||
check_prereqs () {
|
check_prereqs () {
|
||||||
tools=("vhdimount" "umu-run" "fsdecrypt" "xdelta3" "aria2c")
|
tools=("vhdimount" "umu-run" "fsdecrypt" "aria2c" "udisksctl")
|
||||||
echo "Checking for required tools..."
|
echo "Checking for required tools..."
|
||||||
echo "=============================="
|
echo "=============================="
|
||||||
|
|
||||||
|
|
@ -33,7 +35,7 @@ check_prereqs () {
|
||||||
# GET NEEDED APPS FROM $VERSION
|
# GET NEEDED APPS FROM $VERSION
|
||||||
get_required_app () {
|
get_required_app () {
|
||||||
apps=""
|
apps=""
|
||||||
while IFS=',' read -r version url prettyname; do
|
while IFS=',' read -r version url; do
|
||||||
apps+="$url,"
|
apps+="$url,"
|
||||||
if [[ "$version" == "$VERSION" ]]; then
|
if [[ "$version" == "$VERSION" ]]; then
|
||||||
break
|
break
|
||||||
|
|
@ -41,7 +43,29 @@ get_required_app () {
|
||||||
done < <(grep "$(echo "^$VERSION" | cut -c1-4)" imagestore/index.csv)
|
done < <(grep "$(echo "^$VERSION" | cut -c1-4)" imagestore/index.csv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import_from_ins () {
|
||||||
|
result=$(blkid | grep SEGA_INS | head -n 1 | cut -d: -f1 )
|
||||||
|
if [ -n "${result:-}" ]; then
|
||||||
|
echo "Checking SEGA_INS for SDFE .app files..."
|
||||||
|
udisksctl mount --block-device $result
|
||||||
|
mount_point=$(findmnt -n -o TARGET $result)
|
||||||
|
for file in $mount_point/SDFE*.app; do
|
||||||
|
basename=$(basename $file)
|
||||||
|
if [ -f "imagestore/app/$basename" ]; then
|
||||||
|
echo "$basename: File already present on target, skipping."
|
||||||
|
else
|
||||||
|
echo "$basename: Adding file."
|
||||||
|
pv $file > imagestore/app/$basename
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
udisksctl unmount --block-device $result
|
||||||
|
else
|
||||||
|
echo "SEGA_INS not found, skipping."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
extract_apps () {
|
extract_apps () {
|
||||||
|
missingapps=()
|
||||||
mkdir -p imagestore/vhd
|
mkdir -p imagestore/vhd
|
||||||
for url in ${apps//,/ }; do
|
for url in ${apps//,/ }; do
|
||||||
local file=$(basename "$url")
|
local file=$(basename "$url")
|
||||||
|
|
@ -57,15 +81,27 @@ extract_apps () {
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ ! -f imagestore/vhd/$vhd ]; then
|
if [ ! -f imagestore/vhd/$vhd ]; then
|
||||||
echo "Downloading $file"
|
if [ "$airgap" = false ]; then
|
||||||
aria2c -x 8 -j 8 -o imagestore/app/$file $url
|
echo "Downloading $file"
|
||||||
|
aria2c -x 8 -j 8 -o imagestore/app/$file $url
|
||||||
|
|
||||||
echo "Decrypting $file"
|
echo "Decrypting $file"
|
||||||
fsdecrypt imagestore/app/$file
|
fsdecrypt imagestore/app/$file
|
||||||
mv imagestore/app/$vhd imagestore/vhd/
|
mv imagestore/app/$vhd imagestore/vhd/
|
||||||
|
else
|
||||||
|
echo $file
|
||||||
|
missingapps+=("$file")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ ${#missingapps[@]} -gt 0 ]; then
|
||||||
|
echo "ERROR: Missing following .app files for specified version:"
|
||||||
|
for app in ${missingapps[@]}; do
|
||||||
|
echo "- "$app
|
||||||
|
done
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
patchbin () {
|
patchbin () {
|
||||||
|
|
@ -112,10 +148,17 @@ mount () {
|
||||||
sudo="sudo"
|
sudo="sudo"
|
||||||
fi
|
fi
|
||||||
local vhdpath=$(grep "^$version" imagestore/index.csv | cut -d',' -f2 | xargs basename | sed -E "s/.app/.vhd/")
|
local vhdpath=$(grep "^$version" imagestore/index.csv | cut -d',' -f2 | xargs basename | sed -E "s/.app/.vhd/")
|
||||||
mkdir -p $workdir/$version/{dev,lower,upper,game,work}
|
mkdir -p $workdir/$version/{lower,upper,game,work} || true
|
||||||
$sudo vhdimount imagestore/vhd/$vhdpath $workdir/$version/dev
|
if [ -z "$($sudo ls -A "$workdir/$version/dev")" ]; then
|
||||||
$sudo mount -t ntfs -o offset=$((2048*512)),uid=$(id -u),gid=$(id -g) $($sudo find $workdir/$version/dev -maxdepth 1 -type f | sort -V | tail -1) $workdir/$version/$profile/lower
|
mkdir -p $workdir/$version/dev || true
|
||||||
$sudo mount overlay -t overlay -o lowerdir=$workdir/$version/lower,upperdir=$workdir/$version/upper,workdir=$workdir/$version/work $workdir/$version/game
|
$sudo vhdimount imagestore/vhd/$vhdpath $workdir/$version/dev
|
||||||
|
fi
|
||||||
|
if ! df -h | grep -q "$workdir/$version/lower"; then
|
||||||
|
$sudo mount -t ntfs -o offset=$((2048*512)),uid=$(id -u),gid=$(id -g) $($sudo find $workdir/$version/dev -maxdepth 1 -type f | sort -V | tail -1) $workdir/$version/$profile/lower
|
||||||
|
fi
|
||||||
|
if ! df -h | grep -q "$workdir/$version/game"; then
|
||||||
|
$sudo mount overlay -t overlay -o lowerdir=$workdir/$version/lower,upperdir=$workdir/$version/upper,workdir=$workdir/$version/work $workdir/$version/game
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_patches () {
|
apply_patches () {
|
||||||
|
|
@ -126,7 +169,6 @@ apply_patches () {
|
||||||
|
|
||||||
cd ./patches
|
cd ./patches
|
||||||
for script in $(ls -1v 2>/dev/null); do
|
for script in $(ls -1v 2>/dev/null); do
|
||||||
grep -qxF "$script" "$dir/patches";
|
|
||||||
[ -f "$script" ] && [ -r "$script" ] || continue
|
[ -f "$script" ] && [ -r "$script" ] || continue
|
||||||
if ! grep -qxF "$script" "$dir/patches"; then
|
if ! grep -qxF "$script" "$dir/patches"; then
|
||||||
|
|
||||||
|
|
@ -155,10 +197,11 @@ apply_patches () {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
check_prereqs
|
# check_prereqs
|
||||||
get_required_app
|
# get_required_app
|
||||||
extract_apps
|
# import_from_ins
|
||||||
patchbin
|
# extract_apps
|
||||||
mount
|
# patchbin
|
||||||
|
# mount
|
||||||
apply_patches
|
apply_patches
|
||||||
# patchbin "images/vhd/SDFE_2.53.00_20210607052915_3_2.52.00.vhd.old"
|
# patchbin "images/vhd/SDFE_2.53.00_20210607052915_3_2.52.00.vhd.old"
|
||||||
|
|
@ -4,4 +4,10 @@ workdir=${WORKDIR:-/tmp/wacca}
|
||||||
version=${VERSION:-3.07.01}
|
version=${VERSION:-3.07.01}
|
||||||
dir=$workdir/$version
|
dir=$workdir/$version
|
||||||
|
|
||||||
WINEPREFIX=$dir/prefix umu-run $dir/game/bin/launch.bat
|
if [ "$MANGOHUD_ENABLE" = false ]; then
|
||||||
|
mangohud=""
|
||||||
|
else
|
||||||
|
mangohud="mangohud"
|
||||||
|
fi
|
||||||
|
|
||||||
|
WINEPREFIX=$dir/prefix $OPT_ARGS $mangohud umu-run $dir/game/bin/launch.bat
|
||||||
56
patches/10-binpatch.sh
Normal file → Executable file
56
patches/10-binpatch.sh
Normal file → Executable file
|
|
@ -0,0 +1,56 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# SAUCE: https://github.com/Raymonf/whack/blob/master/MercuryPatcher/index.html
|
||||||
|
set -e
|
||||||
|
|
||||||
|
disable_lockout=${BINPATCH_DISABLE_LOCKOUT:-false}
|
||||||
|
force_engine_locale=${BINPATCH_FORCE_ENGINE_LOCALE:-false}
|
||||||
|
allow_chn_region=${BINPATCH_ALLOW_CHN_REGION:-false}
|
||||||
|
force_hidden_luin_title=${BINPATCH_FORCE_HIDDEN_LUIN_TITLE:-false}
|
||||||
|
|
||||||
|
dir=/tmp/wacca/3.07.01
|
||||||
|
file=$dir/game/WindowsNoEditor/Mercury/Binaries/Win64/Mercury-Win64-Shipping.exe
|
||||||
|
|
||||||
|
patch () {
|
||||||
|
local offbytes=$1
|
||||||
|
local onbytes=$2
|
||||||
|
local len=${#offbytes}
|
||||||
|
local result=$(((len / 2)))
|
||||||
|
local offset=$3
|
||||||
|
local enable=$4
|
||||||
|
local description=$5
|
||||||
|
|
||||||
|
local byte_value=$(dd if="$file" bs=1 count=$result skip=$offset 2>/dev/null | hexdump -v -e '/1 "%02X"')
|
||||||
|
if [ "$byte_value" = "$offbytes" ]; then
|
||||||
|
echo -n "[$description] Patch disabled"
|
||||||
|
if [ "$enable" = true ]; then
|
||||||
|
echo "$onbytes" | sed 's/\([0-9A-F]\{2\}\)/\\x\1/g' | xargs -0 printf | dd of="$file" bs=1 count=$result seek=$offset conv=notrunc 2>/dev/null
|
||||||
|
echo -e " -> \u001b[1menabled\u001b[22m"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
elif [ "$byte_value" = "$onbytes" ]; then
|
||||||
|
echo -n "[$description] Patch enabled"
|
||||||
|
if [ "$enable" = false ]; then
|
||||||
|
echo "$offbytes" | sed 's/\([0-9A-F]\{2\}\)/\\x\1/g' | xargs -0 printf | dd of="$file" bs=1 count=$result seek=$offset conv=notrunc 2>/dev/null
|
||||||
|
echo -e " -> \u001b[1mdisabled\u001b[22m"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Patch not applicable - byte is 0x$byte_value (expected 0x$offbytes or 0x$onbytes)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$VERSION" = "3.07.01" ]; then
|
||||||
|
patch E82B5AE4FF4533C0418D5004488BCBE80CACEDFF84C07512BA06 909090909090909090909090909090909090909090909090BA00 5175664 $disable_lockout "Fully disable lockout 0"
|
||||||
|
patch BA02 BA00 5175718 $disable_lockout "Fully disable lockout 1"
|
||||||
|
patch 488D552048 E979FFFFFF 5175794 $disable_lockout "Fully disable lockout 2"
|
||||||
|
|
||||||
|
patch 7407 9090 5603668 $force_engine_locale "Force Engine locale (ignore router country language)"
|
||||||
|
|
||||||
|
patch 75 EB 32682167 $allow_chn_region "Allow using CHN region (don't change to HKG)"
|
||||||
|
|
||||||
|
patch 74 EB 5181434 $force_hidden_luin_title "Force enable Hidden Luin title screen"
|
||||||
|
else
|
||||||
|
echo "Binary patches not applicable to $VERSION, skipping..."
|
||||||
|
fi
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else
|
if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else
|
||||||
wget https://gitea.tendokyu.moe/TeamTofuShop/segatools/releases/download/latest/segatools.zip -O /tmp/segatools.zip
|
wget https://gitea.tendokyu.moe/TeamTofuShop/segatools/releases/download/latest/segatools.zip -O /tmp/segatools.zip
|
||||||
mkdir -p $dir/segatools/{amfs,appdata,option}
|
mkdir -p $dir/segatools/{amfs,appdata,option}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else
|
if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else
|
||||||
if [ -z ${icf+x} ]; then echo "ICF url not set, skipping."; else
|
if [ -z ${icf+x} ]; then echo "ICF url not set, skipping."; else
|
||||||
wget $icf -O $dir/segatools/amfs/ICF1
|
wget $icf -O $dir/segatools/amfs/ICF1
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
if [ -z ${NET_KEYCHIP_ID:-} ]; then
|
if [ -z ${NET_KEYCHIP_ID:-} ]; then
|
||||||
echo "Keychip id not set, skipping.";
|
echo "Keychip id not set, skipping.";
|
||||||
sed -i '/^\[\/Script\/Mercury.MercuryNetworkSettings\]/,/^OfflineMode=false/ s/^OfflineMode=false/OfflineMode=true/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultHardware.ini
|
sed -i '/^\[\/Script\/Mercury.MercuryNetworkSettings\]/,/^OfflineMode=false/ s/^OfflineMode=false/OfflineMode=true/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultHardware.ini
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
sed -i '/^\[elisabeth\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools.ini
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
cp ../wacca_led.dll $dir/game/WindowsNoEditor/Mercury/Plugins/ElizabethPlugin/Source/LEDDevice/Source/Runtime/Public/Externals/USBIntLED.DLL
|
cp ../wacca_led.dll $dir/game/WindowsNoEditor/Mercury/Plugins/ElizabethPlugin/Source/LEDDevice/Source/Runtime/Public/Externals/USBIntLED.DLL
|
||||||
rm $dir/game/WindowsNoEditor/Mercury/Plugins/ElizabethPlugin/Source/LEDDevice/Source/Runtime/Public/Externals/USBIntLED_.DLL
|
rm $dir/game/WindowsNoEditor/Mercury/Plugins/ElizabethPlugin/Source/LEDDevice/Source/Runtime/Public/Externals/USBIntLED_.DLL
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else
|
if [ -z ${dir+x} ]; then echo "\$dir not set, skipping."; exit 22; else
|
||||||
if grep -q "set OPENSSL_ia32cap=:~0x20000000" $dir/game/bin/launch.bat; then echo "Patch already present in file, skipping."; else
|
if grep -q "set OPENSSL_ia32cap=:~0x20000000" $dir/game/bin/launch.bat; then echo "Patch already present in file, skipping."; else
|
||||||
sed -i '/@echo off/Ia set OPENSSL_ia32cap=:~0x20000000' $dir/game/bin/launch.bat
|
sed -i '/@echo off/Ia set OPENSSL_ia32cap=:~0x20000000' $dir/game/bin/launch.bat
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
if [[ "$version" =~ ^1\. ]]; then
|
if [[ "$version" =~ ^1\. ]]; then
|
||||||
sed -i 's/Mercury-Win64-Shipping.exe/Mercury.exe/g' $dir/game/bin/launch.bat
|
sed -i 's/Mercury-Win64-Shipping.exe/Mercury.exe/g' $dir/game/bin/launch.bat
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
if [ -z ${PORT_CONSOLE_LEFT+x} ]; then echo "Left console binding not set, skipping."; else
|
if [ -z ${PORT_CONSOLE_LEFT+x} ]; then echo "Left console binding not set, skipping."; else
|
||||||
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM3 /t REG_SZ /d "$PORT_CONSOLE_LEFT" #Console touch left
|
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM3 /t REG_SZ /d "$PORT_CONSOLE_LEFT" #Console touch left
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
3
patches/50-disableclosingtime.sh
Normal file
3
patches/50-disableclosingtime.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
sed -i 's/^\(.*Closing\(Hour\|Minute\)\)=[0-9-]*/\1=-1/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultGameUserSettings.ini
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
cp -r $dir/game/bin/segatools.ini $dir/game/bin/segatools-netenv.ini
|
cp -r $dir/game/bin/segatools.ini $dir/game/bin/segatools-netenv.ini
|
||||||
sed -i '/^\[netenv\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools-netenv.ini
|
sed -i '/^\[netenv\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools-netenv.ini
|
||||||
sed -i '/inject -d -k mercuryhook.dll ..\/WindowsNoEditor\/Mercury\/Binaries\/Win64/i set SEGATOOLS_CONFIG_PATH=./segatools-netenv.ini' $dir/game/bin/launch.bat
|
sed -i '/inject -d -k mercuryhook.dll ..\/WindowsNoEditor\/Mercury\/Binaries\/Win64/i set SEGATOOLS_CONFIG_PATH=./segatools-netenv.ini' $dir/game/bin/launch.bat
|
||||||
11
patches/50-inject-customs.sh
Executable file
11
patches/50-inject-customs.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
if command -v "MercuryModder" &> /dev/null; then
|
||||||
|
echo -e "\033[0;32m✓\033[0m MercuryModder is installed"
|
||||||
|
else
|
||||||
|
echo -e "\033[0;31m✗\033[0m MercuryModder is NOT installed"
|
||||||
|
exit 127
|
||||||
|
fi
|
||||||
|
MercuryModder prepare --tracks ../customcharts
|
||||||
|
MercuryModder check --tracks ../customcharts
|
||||||
|
MercuryModder modify --tracks ../customcharts --gameDir $dir/game/WindowsNoEditor --output $dir/game/WindowsNoEditor
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue