diff --git a/.gitignore b/.gitignore index e5fc9f7..9e3b3aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # --- +.env # Prerequisites *.d diff --git a/docker-compose.yml b/docker-compose.yml index 56ce57a..9572bac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,4 +13,4 @@ services: container_name: tyra-game-compiler volumes: - tyra-game-volume:/src - - ./:/host + - ./:/host:Z diff --git a/linux-pcsx2.sh b/linux-pcsx2.sh index 8e667ef..0dccbe7 100755 --- a/linux-pcsx2.sh +++ b/linux-pcsx2.sh @@ -33,12 +33,17 @@ find_pcsx2() { fi echo "Error: PCSX2 not found! Please install it, put it in PATH, or specify CUSTOM_PCSX2_PATH in this script." >&2 - exit 1 + return 1 } run_pcsx2() { local pcsx2_cmd - pcsx2_cmd=$(find_pcsx2) + if ! pcsx2_cmd=$(find_pcsx2); then + # Handle the error here, at the top level + exit 1 + fi + local -a pcsx2_args + read -ra pcsx2_args <<< "$pcsx2_cmd" local elf_name elf_name=$(get_target_elf_name) @@ -49,7 +54,6 @@ run_pcsx2() { local target_file target_file="$(pwd)/bin/$elf_name" - if [ ! -f "$target_file" ]; then echo "Error: ELF file not found at $target_file. Did you build the project?" >&2 exit 1 @@ -66,9 +70,9 @@ run_pcsx2() { fi echo "Running PCSX2: $pcsx2_cmd -elf $target_file" - - # Run PCSX2 in the background - $pcsx2_cmd -elf "$target_file" & + + nohup "${pcsx2_args[@]}" -elf "$target_file" > /dev/null 2>&1 & + disown } run_pcsx2