Advertisement
Guest User

Singe run.sh

a guest
Feb 24th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. SCRIPT_DIR=`dirname "$0"`
  4. if realpath / >/dev/null; then SCRIPT_DIR=$(realpath "$SCRIPT_DIR"); fi
  5. SINGE_BIN=singe.bin
  6. DAPHNE_SHARE=~/.daphne
  7.  
  8. function STDERR () {
  9. /bin/cat - 1>&2
  10. }
  11.  
  12. echo "Singe Launcher : Script dir is $SCRIPT_DIR"
  13. cd "$SCRIPT_DIR"
  14.  
  15. # point to our linked libs that user may not have
  16. export LD_LIBRARY_PATH=$SCRIPT_DIR:$DAPHNE_SHARE:$LD_LIBRARY_PATH
  17.  
  18. if [ "$1" = "-fullscreen" ]; then
  19. - FULLSCREEN="-fullscreen"
  20. + FULLSCREEN="-fullscreen_window"
  21. shift
  22. fi
  23.  
  24. if [ -z $1 ] ; then
  25. echo "Specify a game to try: " | STDERR
  26. echo
  27. echo "$0 [-fullscreen] <gamename>" | STDERR
  28. echo
  29.  
  30. echo "Games available: "
  31. for game in $(ls $DAPHNE_SHARE/singe/); do
  32. if [ $game != "actionmax" ]; then
  33. installed="$installed $game"
  34. fi
  35. done
  36. echo "$installed" | fold -s -w60 | sed 's/^ //; s/^/\t/' | STDERR
  37. echo
  38. exit 1
  39. fi
  40.  
  41. if [ ! -f $DAPHNE_SHARE/singe/$1/$1.singe ] || [ ! -f $DAPHNE_SHARE/singe/$1/$1.txt ]; then
  42. echo
  43. echo "Missing file: $DAPHNE_SHARE/singe/$1/$1.singe ?" | STDERR
  44. echo " $DAPHNE_SHARE/singe/$1/$1.txt ?" | STDERR
  45. echo
  46. exit 1
  47. fi
  48.  
  49. ./$SINGE_BIN \
  50. $DAPHNE_SHARE/singe/$1/$1.singe \
  51. $FULLSCREEN \
  52. -framefile $DAPHNE_SHARE/singe/$1/$1.txt \
  53. -homedir $DAPHNE_SHARE \
  54. -datadir $DAPHNE_SHARE \
  55. -sound_buffer 2048 \
  56. -volume_nonvldp 5 \
  57. -volume_vldp 30 \
  58. -x 800 \
  59. -y 600
  60.  
  61. #-keymapfile altsinge.ini \
  62.  
  63. EXIT_CODE=$?
  64.  
  65. if [ "$EXIT_CODE" -ne "0" ] ; then
  66. if [ "$EXIT_CODE" -eq "127" ]; then
  67. echo ""
  68. echo "SINGE failed to start." | STDERR
  69. echo "This is probably due to a library problem." | STDERR
  70. echo "Run ./singe.bin directly to see which libraries are missing." | STDERR
  71. echo ""
  72. else
  73. echo "Loader failed with an unknown exit code : $EXIT_CODE." | STDERR
  74. fi
  75. exit $EXIT_CODE
  76. fi
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement