From fcc7c550cbe4d93ea13011eae3cf840d906cec58 Mon Sep 17 00:00:00 2001 From: Scan Date: Sun, 8 Sep 2024 15:55:24 -0400 Subject: [PATCH] Rework s3p_to_2dx, add args for IIDX 31 to ep_bm2dxnix (now named bm2dnix), update readme --- README.md | 29 +++++++++++++++++++---------- ep_bm2dxnix | 41 ++++++++++++++++++++++++----------------- s3p_to_2dx | 39 +++++++++++++-------------------------- 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 2617847..95c5d9a 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,19 @@ # bm2dnix Helper Scripts -This repo may seem erratic with no documentation whatsoever. -This is because resources listed here are part of a bigger private repository. +This repo may seem erratic with no documentation whatsoever. This is a collection of python & shell scripts to assist with the following: +- Wineprefix setup +- Proton patches/setup +- Automated configuration & launching for various titles (for running titles with varying requirements) +- Converting Wine stack traces for debugging +- Wrappers for special Wineprefix environments *(no longer maintained)* ## s3p_to_2dx *This script is currently in its proof of concept stage. Please examine it before trying to run it, I reccommend copying your sound data elsewhere and running the script in there.* -Helper script to convert .s3p .wma containers to .2dx .wav containers. Needed for songs in 25+ to play properly without *disable-fx* patches applied. +Helper script to convert .s3p .wma containers to .2dx .wav containers. Needed for songs in 25+ to play properly without *disable-fx* patches applied. This script can be run on game updates/deltas, or directly in the games sound directory. -Dependencies (must to be registered to /usr/bin): +Dependencies: - bash - ffmpeg - [ifstools](https://github.com/mon/ifstools) @@ -17,13 +21,18 @@ Dependencies (must to be registered to /usr/bin): - [s3p_extract](https://github.com/mon/s3p_extract) (Thank you mon/xyen!) Usage: -- Define your sound directory in `SOUND_DIR` -`./s3p_to_2dx` +- This script assumes external dependencies are registered to $PATH by default +- Binary directories must be specified in command-line arguments otherwise +- `./s3p_to_2dx -s -e -b -i -f ` + +## bm2dnix + +This tool supports launching IIDX by chainloading bm2dnix -> ep_protonnix -> proton/proton-ge -> spicetools. This script expects things to be located in Steam directories + +Usage: +- See the help command for examples and usage +- `bm2dnix --help` ## etc You don't have to use anything from this repo to get games running as these are just there to make process feel more seamless. - -That being said part of a guide listed at pages may be harder to follow without any system integration whatsoever, therefore this repository exists, providing the minimal wrappers setup that should work with guide provided. - -If it doesn't, create a new issue here, as some wrappers here may be outdated. diff --git a/ep_bm2dxnix b/ep_bm2dxnix index 0352c4d..3953614 100755 --- a/ep_bm2dxnix +++ b/ep_bm2dxnix @@ -161,14 +161,21 @@ args_iidx22() { [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_local[@]}") } -args_iidx30() { - # pipewire supported, fullscreen partially? working subscreen - _G_args+=("${_C_audio_dummy_pipewire[@]}" "${_C_lightning_model[@]}" -nolegacy -touchemuforce) - [ "$_G_video" != "stable" ] || _G_args+=(-graphics-force-single-adapter) +args_iidx25() { + # pipewire supported, fullscreen breaks on window unfocus + _G_args+=("${_C_audio_dummy_pipewire[@]}") + [ "$_G_video" != "stable" ] || _G_args+=(-w) + [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_local[@]}") +} + +args_iidx26() { + # pipewire supported, fullscreen breaks on window unfocus + _G_args+=("${_C_audio_dummy_pipewire[@]}") + [ "$_G_video" != "stable" ] || _G_args+=(-w) [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_maint[@]}") } -args_iidx29() { +args_iidx27() { # pipewire supported, fullscreen working subscreen _G_args+=("${_C_audio_dummy_pipewire[@]}" "${_C_lightning_model[@]}" -nolegacy -touchemuforce) [ "$_G_video" != "stable" ] || _G_args+=(-graphics-force-single-adapter) @@ -197,28 +204,28 @@ args_iidx28() { [ "$_G_video" != "stable" ] || _G_args+=(-graphics-force-single-adapter) [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_maint[@]}") fi - } -args_iidx27() { +args_iidx29() { # pipewire supported, fullscreen working subscreen _G_args+=("${_C_audio_dummy_pipewire[@]}" "${_C_lightning_model[@]}" -nolegacy -touchemuforce) [ "$_G_video" != "stable" ] || _G_args+=(-graphics-force-single-adapter) [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_maint[@]}") } -args_iidx26() { - # pipewire supported, fullscreen breaks on window unfocus - _G_args+=("${_C_audio_dummy_pipewire[@]}") - [ "$_G_video" != "stable" ] || _G_args+=(-w) +args_iidx30() { + # pipewire supported, fullscreen partially? working subscreen + _G_args+=("${_C_audio_dummy_pipewire[@]}" "${_C_lightning_model[@]}" -nolegacy -touchemuforce) + [ "$_G_video" != "stable" ] || _G_args+=(-graphics-force-single-adapter) [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_maint[@]}") } -args_iidx25() { - # pipewire supported, fullscreen breaks on window unfocus - _G_args+=("${_C_audio_dummy_pipewire[@]}") - [ "$_G_video" != "stable" ] || _G_args+=(-w) - [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_local[@]}") +args_iidx31() { + # pipewire supported, only tested in LDJ + # TDJ still being tested + _G_args+=("${_C_audio_dummy_pipewire[@]}" "${_C_lightning_model[@]}" -nolegacy -touchemuforce) + [ "$_G_video" != "stable" ] || _G_args+=(-graphics-force-single-adapter) + [ "$_G_url" != "dummy" ] || _G_args+=("${_C_net_dummy_maint[@]}") } gen_args() { @@ -321,7 +328,7 @@ gen_base() { # Apply environment cd "$styledir" || abort "INVALID PATH" - _G_ep+=(--exec "$_G_exec" --uniqueid "$patchid" --runtime "$_G_root/steamapps/common/$_C_rtname" --prefix "$_G_root/steamapps/compatdata/$_C_pfxname" --steam-dir "$_G_root") + _G_ep+=(--exec "$_G_exec" --uniqueid "$patchid" --prefix "$_G_root/steamapps/compatdata/$_C_pfxname" --steam-dir "$_G_root") # Remove application of steam runtime } sanity_check() { diff --git a/s3p_to_2dx b/s3p_to_2dx index 557f920..f9c46ae 100755 --- a/s3p_to_2dx +++ b/s3p_to_2dx @@ -5,7 +5,8 @@ SOUND_DIR="please-set-this" # Extract .ifs file and descend into its directory -extract_ifs() { +# Sound data doesn't need to be repacked into .ifs - easier for the sake of managing future updates +extract_cleanup_ifs() { local ifs_file="$1" echo "Extracting $ifs_file..." ifstools "$ifs_file" || { echo "Failed to extract $ifs_file"; return 1; } @@ -13,20 +14,6 @@ extract_ifs() { [ -d "$extracted_dir" ] && cd "$extracted_dir" || { echo "Directory $extracted_dir not found"; return 1; } } -# Repack .ifs file and move it output to parent directory -repack_to_ifs() { - local ifs_dir= - echo "Repacking $ifs_dir to $output_name..." - - # Get the current working directory name - dir_name=$(basename "$OLDPWD") - - # Remove the "_ifs" suffix from the directory name if it exists - output_name="${dir_name%_ifs}" - - ifstools "$output_name" || { echo "Failed to repack $dir_name"; return 1; } - mv "$output_name".ifs .. -} # Extract and convert .s3p files extract_convert_s3p() { @@ -38,14 +25,14 @@ extract_convert_s3p() { for wma_file in *.wma; do [ -e "$wma_file" ] || continue - echo "Converting $wma_file..." - ffmpeg -loglevel error -i "$wma_file" -acodec adpcm_ms -b:a 256k "${wma_file%.*}.wav" && rm -f "$wma_file" # Write to /dev/null instead maybe? ffmpeg is loud asf + echo -ne "Converting $wma_file..."\\r + ffmpeg -loglevel error -i "$wma_file" -acodec adpcm_ms -b:a 256k "${wma_file%.*}.wav" && rm -f "$wma_file" # Writes to log instead done } # Repack .wav files into .2dx repack_to_2dx() { - echo "Repacking files to .2dx format..." + echo "Repacking files to .2dx..." # Get the current working directory name dir_name=$(basename "$OLDPWD") @@ -56,7 +43,7 @@ repack_to_2dx() { 2dxBuild "$output_name".2dx || { echo "Failed to repack files"; return 1; } mv "$output_name".2dx .. cd .. - rm -rf *s3p* # This is kinda risky but whatever lol + rm -rf *s3p* } # Iterate through directories and .ifs in $SOUND_DIR @@ -66,17 +53,17 @@ process_sound_files() { exit 1 fi - # Process directories for songs not contained in .ifs + # Unpack.ifs files into directories + for ifs_file in "$SOUND_DIR"/*.ifs; do + echo "Processing IFS file: $ifs_file" + (cd "$SOUND_DIR" && extract_cleanup_ifs "$ifs_file") + done + + # Convert all directories for dir in "$SOUND_DIR"/*/; do echo "Processing directory: $dir" (cd "$dir" && extract_convert_s3p *.s3p && repack_to_2dx) done - - # Process .ifs files for songs contained in .ifs - for ifs_file in "$SOUND_DIR"/*.ifs; do - echo "Processing IFS file: $ifs_file" - (cd "$SOUND_DIR" && extract_ifs "$ifs_file" && extract_convert_s3p *.s3p && repack_to_2dx && repack_to_ifs) - done } # Execute the main function