29 lines
725 B
Bash
29 lines
725 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||
|
|
game_dir="$repo_root/rt3_wineprefix/drive_c/rt3"
|
||
|
|
log_path="$game_dir/rrt_hook_attach.log"
|
||
|
|
proxy_path="$game_dir/dinput8.dll"
|
||
|
|
|
||
|
|
. "$HOME/.local/share/cargo/env"
|
||
|
|
|
||
|
|
cargo build -p rrt-hook --target i686-pc-windows-gnu
|
||
|
|
|
||
|
|
rm -f "$log_path"
|
||
|
|
cp "$repo_root/target/i686-pc-windows-gnu/debug/dinput8.dll" "$proxy_path"
|
||
|
|
|
||
|
|
(
|
||
|
|
cd "$game_dir"
|
||
|
|
timeout 8s env \
|
||
|
|
WINEPREFIX="$repo_root/rt3_wineprefix" \
|
||
|
|
WINEDLLOVERRIDES="dinput8=n,b" \
|
||
|
|
/opt/wine-stable/bin/wine RT3.exe
|
||
|
|
) >/tmp/rrt-hook-wine.log 2>&1 || true
|
||
|
|
|
||
|
|
if [[ -f "$log_path" ]]; then
|
||
|
|
cat "$log_path"
|
||
|
|
else
|
||
|
|
echo "attach-log-missing" >&2
|
||
|
|
exit 1
|
||
|
|
fi
|