Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !#/bin/sh
- # Inukaze - ePSXe Launcher
- # Blog : http://inukaze.wordpress.com
- # License GPL
- # If you use this source code or part of this , you must specify the Autor and the part
- # of this source code are you using.
- # Special Thanks to : Facebook user "Beakos GNU Linux" for giveme the command "sed 's/[.].*//'"
- # Special Thanks to : ArchLinux user "alfPlayer" for commands Like "Path=${0%/*}"
- # & Testing and Corrections Ideas for this Script
- clear && reset
- # Change to game directory
- ePSXe_Path=${0%/*}
- cd "$ePSXe_Path"
- # Checking if there are relevant files and directories
- # For the correct execution of the emulator ePSXe.
- if [ ! -f keycodes.lst ] || [ ! -f bios/scph1001.bin ] || [ ! -e cfg ] || [ ! -e plugins ] || [ ! -e memcards ]
- then
- echo "Missing needs files / and / directories in `$ePSXe_Path`"
- echo "Your ePSXe is incomplete!"
- exit 1
- fi
- # Determining CPU Speed
- CPUMHz=`dmesg | grep "MHz processor" | cut -d " " -f07 | sed 's/[.].*//'`
- if [ "$CPUMHz" -ge "800" ]
- then
- if [ "$CPUMHz" -ge "1048" ]
- then
- let "CPUGHz"=$CPUMHz/1000
- echo "You have $CPUGHz GHz Processor"
- else
- echo "You have $CPUMHz Mhz Processor"
- fi
- else
- echo "You need a 800 MHz Processor to run ePSXe"
- fi
- # Determining If the user has enough RAM to run the emulator
- RAM_Kb=`grep MemTotal /proc/meminfo | awk '{print $2}'`
- if [ "$RAM_Kb" -ge "128000" ]
- then
- if [ "$RAM_Kb" -ge "1096000" ]
- then
- let "RAMGb"=$RAM_Kb/1000
- echo "You have $RAMGb GB Ram"
- else
- let RAM_MB=$RAM_Kb/1000
- echo "You have $RAM_MB MB RAM"
- fi
- else
- echo "You need 128 MB RAM , please install more RAM Memory"
- fi
- # Determining Video Card & Video Card Size & 3D Support
- vcard=`lspci -v | grep "VGA" | cut -d " " -f05`
- if [ "$vcard" = nVidia ]
- then
- echo "You have NVIDIA Graphics Card"
- nv_card_size=`nvidia-settings -q VideoRam | grep "Attribute 'VideoRam'" | cut -d " " -f06 | sed 's/[.].*//'`
- if [ "$nv_card_size" -ge "64000" ]
- then
- let nvcard_mbmem=$nv_card_size/1000
- echo "You have $nvcard_mbmem MB VIDEO"
- nvsupport3d=`nvidia-settings -g | grep "direct rendering: Yes" | cut -d " " -f05`
- if [ $nvsupport3d = "Yes" ]
- then
- echo "You have 3D Support & Direct Rendering"
- else
- echo "You dont have 3D Support"
- echo "You need 3D Support to use ePSXe to run PlayStation 1 Games"
- fi
- else
- echo ""
- echo "You need 64 MB Video Card with 3D Support"
- echo ""
- fi
- else
- echo "You have $vcard Video Card"
- vidsize=lspci -v -s `lspci | awk '/VGA/{print $1}'` | sed -n '/Memory.*, prefetchable/s/.*\[size=\([^]]\+\)M\]/\1/p'
- if [ "$vidsize" -ge 64 ]
- then
- echo "You have $vidsize MB Video"
- support3d=glxinfo | grep "direct rendering: Yes" | cut -d " " -f03
- if [ $support3d = Yes ]
- then
- echo "You have 3D Support & Direct Rendering"
- else
- echo "You dont have 3D Support"
- echo "You need 3D Support to use ePSXe to run PlayStation 1 Games"
- fi
- else
- echo "You need 64 MB Video Card to Gaming with ePSXe"
- fi
- # Determining Operating System Architecture
- MACHINE=`uname -m`
- if [ "$MACHINE" = "x86_64" ]
- then
- export LD_LIBRARY_PATH="$ePSXe_Path/32bits_libs"
- echo ""
- echo ""
- BIN=./.epsxe
- chmod 666 $ePSXe_Path/cfg/*.cfg $ePSXe_Path/sstates/* \
- $ePSXe_Path/memcards/*.mcr $ePSXe_Path/snap/* 2>/dev/null
- else
- echo ""
- echo ""
- BIN=./.epsxe
- chmod 666 $ePSXe_Path/cfg/*.cfg $ePSXe_Path/sstates/* \
- $ePSXe_Path/memcards/*.mcr $ePSXe_Path/snap/* 2>/dev/null
- fi
- # Run the ePSXe - Sony PlayStation Emulator:
- $BIN "$@"
- # Check for errors
- e=$?
- if [ $e -ne 0 ]
- then
- echo ""
- echo "It looks like ePSXe crashed! If you need support, please include the"
- echo "contents of the log file in your problem report."
- LOGPATH="$HOME/.epsxe/epsxe.log"
- if [ -f "$LOGPATH" ]
- then
- echo "The log file is stored at: $LOGPATH"
- echo "" >> $LOGPATH
- echo "Libraries used:" >> $LOGPATH
- ldd $BIN >> $LOGPATH 2>&1
- echo "" >> $LOGPATH
- GLXINFO=`which glxinfo`
- if [ -z "$GLXINFO" ]
- then
- echo "glxinfo not found!" >> $LOGPATH
- else
- echo "Output of glxinfo:" >>$LOGPATH
- glxinfo >>$LOGPATH 2>&1
- fi
- else
- echo "Unfortunately, no log file has been created!"
- fi
- fi
- exit $e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement