31 lines
918 B
Bash
Executable file
31 lines
918 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
game_dir="$repo_root/rt3_wineprefix/drive_c/rt3"
|
|
proxy_path="$game_dir/dinput8.dll"
|
|
save_stem="${1:-hh}"
|
|
. "$HOME/.local/share/cargo/env"
|
|
|
|
cargo build -p rrt-hook --target i686-pc-windows-gnu
|
|
cp "$repo_root/target/i686-pc-windows-gnu/debug/dinput8.dll" "$proxy_path"
|
|
|
|
cd "$game_dir"
|
|
export RRT_AUTO_LOAD_SAVE="$save_stem"
|
|
export WINEPREFIX="$repo_root/rt3_wineprefix"
|
|
export WINEDLLOVERRIDES="dinput8=n,b"
|
|
|
|
cmd=(/opt/wine-stable/bin/winedbg)
|
|
cmd_file="${RRT_WINEDBG_CMD_FILE:-$repo_root/tools/winedbg_auto_load_crash.cmd}"
|
|
if [[ -n "$cmd_file" ]]; then
|
|
cmd+=(--file "$cmd_file")
|
|
fi
|
|
cmd+=(RT3.exe)
|
|
|
|
log_file="${RRT_WINEDBG_LOG:-$repo_root/rt3_auto_load_winedbg.log}"
|
|
if [[ -n "$log_file" ]]; then
|
|
cmd_string="$(printf '%q ' "${cmd[@]}")"
|
|
exec script -qefc "${cmd_string% }" "$log_file"
|
|
fi
|
|
|
|
exec "${cmd[@]}"
|