GZDOOM: edited script, added config and preliminary reset function

This commit is contained in:
XargonWan 2023-11-23 16:11:55 +01:00
parent 2788beebb9
commit 7187ef3f55
6 changed files with 3551 additions and 7 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
input_file="$1" input_file="$1"
params="" params=""
LOG_FILE="$rdhome/.logs/gzdoom.log" LOG_FILE="$rdhome/.logs/gzdoom.log"
command='gzdoom +fluid_patchset /app/share/sounds/sf2/gzdoom.sf2 $params >> "$LOG_FILE" 2>&1' command="gzdoom +fluid_patchset /app/share/sounds/sf2/gzdoom.sf2 -config /var/config/gzdoom/gzdoom.ini $params >> "$LOG_FILE" 2>&1"
# Function to log messages # Function to log messages
log() { log() {
@ -16,8 +16,13 @@ log() {
# Check if the file is .wad or .WAD # Check if the file is .wad or .WAD
if [[ $input_file =~ \.wad$ || $input_file =~ \.WAD$ ]]; then if [[ $input_file =~ \.wad$ || $input_file =~ \.WAD$ ]]; then
log "Processing file: $input_file" log "Processing file: $input_file"
exec $command # Execute the command and check for success
log "Command executed with parameters: retroarch -L /app/share/libretro/cores/gzdoom_libretro.so $params" if exec "$command"; then
log "Command executed successfully"
else
log "Error executing command"
fi
# Check if the file is .doom # Check if the file is .doom
elif [[ $input_file =~ \.doom$ ]]; then elif [[ $input_file =~ \.doom$ ]]; then
log "Processing file: $input_file" log "Processing file: $input_file"
@ -25,8 +30,16 @@ elif [[ $input_file =~ \.doom$ ]]; then
params+="-file $line " params+="-file $line "
log "Added -file $line to parameters" log "Added -file $line to parameters"
done < "$input_file" done < "$input_file"
exec $command # Execute the command and check for success
log "Command executed with parameters: retroarch -L /app/share/libretro/cores/gzdoom_libretro.so -file $params" if exec "$command"; then
log "Command executed successfully"
log "Expanded command:"
log "$command"
else
log "Error executing command"
log "Expanded command:"
log "$command"
fi
else else
echo "Unsupported file format. Please provide a .wad, .WAD, or .doom file." echo "Unsupported file format. Please provide a .wad, .WAD, or .doom file."
log "Unsupported file format: $input_file" log "Unsupported file format: $input_file"

View file

@ -710,7 +710,19 @@ prepare_emulator() {
echo "----------------------" echo "----------------------"
mkdir -p "/var/config/mame" mkdir -p "/var/config/mame"
mkdir -p "$emuconfigs/mame/**" "/var/config/mame" cp -fvr "$emuconfigs/mame/**" "/var/config/mame"
fi
if [[ "$emulator" =~ ^(gzdoom|GZDOOM|all)$ ]]; then
# TODO: do a proper script
# This is just a placeholder script to test the emulator's flow
echo "----------------------"
echo "Initializing GZDOOM"
echo "----------------------"
mkdir -p "/var/config/gzdoom"
cp -fvr "$emuconfigs/gzdoom/gzdoom.ini" "/var/config/gzdoom"
fi fi

View file

@ -1357,7 +1357,7 @@ modules:
- ln -s /app/tools/configurator.sh /app/bin/configurator - ln -s /app/tools/configurator.sh /app/bin/configurator
# DOOM/WOLF parsers # DOOM/WOLF parsers
- cp emu-configs/parsers/*.sh ${FLATPAK_DEST}/bin - cp emu-configs/gzdoom/*.sh ${FLATPAK_DEST}/bin
sources: sources:
- type: git - type: git

View file

@ -72,6 +72,7 @@ source /app/libexec/global.sh
# - Reset Citra # - Reset Citra
# - Reset Dolphin # - Reset Dolphin
# - Reset Duckstation # - Reset Duckstation
# - Reset GZDoom
# - Reset MelonDS # - Reset MelonDS
# - Reset PCSX2 # - Reset PCSX2
# - Reset PPSSPP # - Reset PPSSPP