diff --git a/.config example b/.config example deleted file mode 100644 index 5d015ce..0000000 --- a/.config example +++ /dev/null @@ -1,21 +0,0 @@ -WORKDIR="/tmp/wacca" -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="3.07.01" -# NETWORKING -NET_KEYCHIP_ID="" -NET_HOSTNAME="" -NET_COMPATIBILITY="3.0" # Which versions to enable networking for (3.0,2.5,1.0 e.t.c) -# PORT BINDINGS -PORT_CONSOLE_LEFT="" -PORT_CONSOLE_RIGHT="" -PORT_AIME_READER="" -# APPLY BINARY PATCHES 3.07.01 ONLY -BINPATCH_DISABLE_LOCKOUT=0 # Fully disable lockout -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_FORCE_HIDDEN_LUIN_TITLE=0 # Force enable Hidden Luin title screen -ENABLE_EN_US_TRANSLATION=1 \ No newline at end of file diff --git a/.config.example b/.config.example new file mode 100644 index 0000000..c397092 --- /dev/null +++ b/.config.example @@ -0,0 +1,22 @@ +WORKDIR="/tmp/wacca" +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 +ELAPSEIO_ENABLE=true # Enable mercuryhook .dll that connects with ELApse +# VERSION +VERSION="3.07.01" +# NETWORKING +NET_KEYCHIP_ID="" +NET_HOSTNAME="" +NET_COMPATIBILITY="3.0" # Which versions to enable networking for (3.0,2.5,1.0 e.t.c) +# PORT BINDINGS +PORT_CONSOLE_LEFT="" +PORT_CONSOLE_RIGHT="" +PORT_AIME_READER="" +# APPLY BINARY PATCHES 3.07.01 ONLY +BINPATCH_DISABLE_LOCKOUT=false # Fully disable lockout +BINPATCH_FORCE_ENGINE_LOCALE=false # Force Engine locale (ignore router country language) (Enable if using ENABLE_EN_US_TRANSLATION with online mode) +BINPATCH_ALLOW_CHN_REGION=false # Allow using CHN region (don't change to HKG) +BINPATCH_FORCE_HIDDEN_LUIN_TITLE=false # Force enable Hidden Luin title screen +ENABLE_EN_US_TRANSLATION=false # Enable translation injection from ./imagestore/misc/translations/*.toml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2b18b1e..01f094f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ images/* imagestore/app/*.app imagestore/vhd/*.vhd -imagestore/misc/ICF1 -imagestore/misc/*.zip -customcharts/* +imagestore/misc/* +!imagestore/misc/README.md +!imagestore/misc/translations/README.md +!imagestore/misc/customcharts/README.md .config \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..de61ea8 --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# wackman + +Bunch of scripts to assist in running WACCA on linux +**WARNING:** I made these scripts for personal use. Use with your own discretion. +**ANOTHER WARNING:** The data for WACCA S (1.50) from archive.org is corrupted. The game will not work with this version. +## Requirements +- [vhditools](https://github.com/libyal/libvhdi) (Build from git, otherwise vhdimount will complain about missing VHDI subsystem) +- [umu-launcher](https://github.com/Open-Wine-Components/umu-launcher) +- [fsdecrypt](https://gitea.tendokyu.moe/beerpsi/fsdecrypt) +- [aria2c](https://aria2.github.io/) +- udisks2 +- [MercuryModder](https://github.com/szymex73/MercuryModder) (**Optional:** only required for injecting charts into the game) +- [metra](https://git.drgn.moe/BlackDragon/metra) (**Optional:** Only required for injecting english translations into the game) +- [mangohud](https://github.com/flightlessmango/MangoHud) (**Optional:** Only required if you want to have a FPS counter) + +## Configuration +Configuration is done with the `.config` file, an example can be found in `.config.example` + +## Folder structure +- imagestore: + - index.csv: File containing all versions of the game with their respective archive.org links + - app: Folder containing source .app files + - vhd: Folder containing decrypted .vhd files + - misc: + - customcharts: Folder containing custom charts for MercuryModder to inject + - translations: Folder containing .toml files like [this](https://gitea.tendokyu.moe/Raymonf/WACCA-en_US/) that contain translations for the game + - ICF1: File that is required by the game + - segatools.zip: File that is required by the game + +## What do the scripts do? +### ./init.sh +- check_prereqs: Check if requirements are installed +- get_required_app: Get a list of required .app files +- import_from_ins: Check for the presence of a SEGA_INS drive and pulls game files from it +- extract_apps: + - Download .app from archive.org with aria2c (Only if `AIRGAP=false` in .config) + - Extract the .vhd from the .app with fsdecrypt +- patchbin: Normalize the parent filename of the .vhd so that vhdimount wont freak out +- mount: + - Make required folders in \$WORKDIR/\$VERSION + - Mount the blockdevice that `vhdimount` presents in \$WORKDIR/\$VERSION/dev + - Mount the NTFS partition from the mounted blockdevice in \$WORKDIR/\$VERSION/lower + - Mount an overlayfs consisting of the \$WORKDIR/\$VERSION/lower at \$WORKDIR/\$VERSION/game +- apply_patches: Apply scripts from the ./patches dir that configure the game to work +### ./launch.sh +- Launches the game +### ./unmount.sh +- Unmounts the game files + diff --git a/imagestore/misc/customcharts/README.md b/imagestore/misc/customcharts/README.md new file mode 100644 index 0000000..a17edfd --- /dev/null +++ b/imagestore/misc/customcharts/README.md @@ -0,0 +1 @@ +# Place charts here (In Mercurymodder format) \ No newline at end of file diff --git a/imagestore/misc/translations/README.md b/imagestore/misc/translations/README.md new file mode 100644 index 0000000..6d2f157 --- /dev/null +++ b/imagestore/misc/translations/README.md @@ -0,0 +1 @@ +# Place translations here (in WTT format) \ No newline at end of file diff --git a/init.sh b/init.sh index a04b1ad..29a3a36 100755 --- a/init.sh +++ b/init.sh @@ -79,7 +79,6 @@ import_from_ins () { extract_apps () { missingapps=() - mkdir -p imagestore/vhd for url in ${apps//,/ }; do local file=$(basename "$url") local vhd=$(basename "$url" | sed -E "s/.app/.vhd/") diff --git a/launch.sh b/launch.sh index f1a8ad8..f81d68b 100755 --- a/launch.sh +++ b/launch.sh @@ -1,3 +1,4 @@ +#!/bin/bash source .config workdir=${WORKDIR:-/tmp/wacca} diff --git a/patches/10-binpatch.sh b/patches/10-binpatch.sh index 12102f6..922cfe6 100755 --- a/patches/10-binpatch.sh +++ b/patches/10-binpatch.sh @@ -7,7 +7,6 @@ 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 () { diff --git a/patches/10-segatools.sh b/patches/10-segatools.sh index 2bd0b0a..15d9292 100755 --- a/patches/10-segatools.sh +++ b/patches/10-segatools.sh @@ -23,12 +23,12 @@ sed -i '/^\[vfs\]/,/^\[/ { /^appdata=/c\appdata=..\\\\..\\\\segatools\\\\appdata }' $dir/game/bin/segatools.ini -if [ -z ${PORT_AIME_READER:-} ]; then echo "\$Card reader binding not set, skipping."; else +if [ -z ${PORT_AIME_READER:-} ]; then echo "Card reader binding not set, skipping."; else echo "Card reader binding set, disabling card reader assembly emulation" sed -i '/^\[aime\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools.ini fi -if [ -z ${PORT_CONSOLE_LEFT:-} ]; then echo "\$Left console binding not set, skipping."; else - if [ -z ${PORT_CONSOLE_RIGHT:-} ]; then echo "\$Right console binding not set, skipping."; else +if [ -z ${PORT_CONSOLE_LEFT:-} ]; then echo "Left console binding not set, skipping."; else + if [ -z ${PORT_CONSOLE_RIGHT:-} ]; then echo "Right console binding not set, skipping."; else echo "Console binding set, disabling mercuryio touch hooks" sed -i '/^\[touch\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools.ini fi diff --git a/patches/15-en-translation.sh b/patches/15-en-translation.sh new file mode 100644 index 0000000..fd389f7 --- /dev/null +++ b/patches/15-en-translation.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e +translate=${ENABLE_EN_US_TRANSLATION:-false} +if [ "$translate" = true ]; then + if command -v "metra" &> /dev/null; then + echo -e "\033[0;32m✓\033[0m metra is installed" + else + echo -e "\033[0;31m✗\033[0m metra is NOT installed" + exit 127 + fi + metra -m $dir/game/WindowsNoEditor/Mercury/Content/Message -t ../imagestore/misc/translations + sed -i '/^\[Internationalization\]/,/^Culture=ja-JP/ s/^Culture=ja-JP/Culture=en-US/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultEngine.ini +fi \ No newline at end of file diff --git a/patches/50-inject-customs.sh b/patches/50-inject-customs.sh index 87fcbea..3d60780 100755 --- a/patches/50-inject-customs.sh +++ b/patches/50-inject-customs.sh @@ -6,6 +6,6 @@ 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 \ No newline at end of file +MercuryModder prepare --tracks ../imagestore/misc/customcharts +MercuryModder check --tracks ../imagestore/misc/customcharts +MercuryModder modify --tracks ../imagestore/misc/customcharts --gameDir $dir/game/WindowsNoEditor --output $dir/game/WindowsNoEditor \ No newline at end of file