Advertisement
inukaze

Inukaze - pcsxr config replacer

Sep 22nd, 2011
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.18 KB | None | 0 0
  1. # Inukaze - pcsxr custom config replacer by each game title
  2. # you can see too in : http://ubuntuforums.org/showthread.php?p=11277492#post11277492
  3.  
  4. # You must create a "folder"/"directory" or simbolyc link inside "/home/my_user/.pcsxr/" called "config"
  5. # and you must put the same name of file of "CD IMAGEN" , for example
  6.  
  7. # if you game its : "Final Fantasy VII CD1.iso" , the must create a new sub-folder inside the "config"
  8. # folder , called "Final Fantasy VII CD1" , and put there the files
  9.  
  10. # "dfcdrom.cfg" , "dfinput.cfg" , "dfsound.cfg" .
  11.  
  12. # For 2D Games you should use : 1 - "dfxvideo.cfg" or 2 - "gxvideo.cfg"
  13. # For 3D Games you should use : 3 - "PeopsMesaGL.cfg"
  14.  
  15. # Copy to the "Config"/"Game Name" , the file called "pcsxr.cfg" and rename it to "Gamename" for example "Final Fantasy VII CD1.cfg" . and now , you can run games with my mini script :
  16.  
  17. # Mini-Script - pcsxr-launcher / CODE :
  18.  
  19. #!/bin/bash
  20. filename="${1%.*}"
  21. gamename="${filename##*/}"
  22. basename="${filename##*/}"
  23. gamedir="${basename%.*}"
  24.  
  25. # Copy the Config File for Emulator :
  26. cd "$HOME/.pcsxr/config/$gamedir"
  27. cp "$gamename.cfg" "$HOME/.pcsxr/"
  28. cd "$HOME/.pcsxr"
  29. mv "pcsxr.cfg" "pcsxr.cfg.bak"
  30. mv "$gamename.cfg" "pcsxr.cfg"
  31. echo " STEP 01 - Backup Original File & Replace it "
  32.  
  33. # Backup current cfgs plugins files
  34. cd "$HOME/.pcsxr/plugins"
  35. mv dfcdrom.cfg dfcdrom.cfg.bak
  36. mv dfinput.cfg dfinput.cfg.bak
  37. mv dfsound.cfg dfsound.cfg.bak
  38. mv dfxvideo.cfg dfxvideo.cfg.bak
  39. mv gpuPeopsMesaGL.cfg gpuPeopsMesaGL.cfg.bak
  40. mv gxvideo.cfg gxvideo.cfg.bak
  41. echo " STEP 02 - Backup current config files of plugins "
  42.  
  43. # Remove current cfgs plufins files
  44. cd "$HOME/.pcsxr/plugins"
  45. rm -rf dfcdrom.cfg
  46. rm -rf dfinput.cfg
  47. rm -rf dfsound.cfg
  48. rm -rf gxvideo.cfg
  49. rm -rf dfxvideo.cfg
  50. rm -rf gpuPeopsMesaGL.cfg
  51. echo " STEP 03 - Cleaned current config files of plugins "
  52.  
  53. # Using the Config Files for Plugins :
  54. cd "$HOME/.pcsxr/config/$gamedir"
  55.  
  56.     if [ -e dfcdrom.cfg ] || [ -e dfinput.cfg ] || [ -e dfsound.cfg ]
  57.     then
  58.         cp -rf dfcdrom.cfg  "$HOME/.pcsxr/plugins"
  59.         cp -rf dfinput.cfg  "$HOME/.pcsxr/plugins"
  60.         cp -rf dfsound.cfg  "$HOME/.pcsxr/plugins"
  61.     fi
  62.  
  63.     if  [ -e dfxvideo.cfg ]
  64.     then
  65.         cp -rf dfxvideo.cfg "$HOME/.pcsxr/plugins"
  66.     fi
  67.     if [ -e gxvideo.cfg ]
  68.     then
  69.         cp -rf gxvideo.cfg  "$HOME/.pcsxr/plugins"
  70.     fi
  71.     if [ -e gpuPeopsMesaGL.cfg ]
  72.     then
  73.         cp -rf gpuPeopsMesaGL.cfg "$HOME/.pcsxr/plugins"
  74.     fi
  75.  
  76. echo " STEP 04 - Using config files for $gamedir "
  77.  
  78. # Begin Emulator & wait emulator exit :
  79. echo " STEP 05 - Begin emulation of $gamedir "
  80. pcsxr -slowboot -nogui -cdfile "$@"
  81. wait $pid
  82. # Finish Emulation
  83.  
  84. # Restore Files :
  85. cd "$HOME/.pcsxr"
  86. rm -rf pcsxr.cfg
  87. mv pcsxr.cfg.bak pcsxr.cfg
  88. echo " STEP 05 - Emulation of $gamedir finished "
  89.  
  90. # Remove current cfgs plufins files
  91. cd "$HOME/.pcsxr/plugins"
  92. rm -rf dfcdrom.cfg
  93. rm -rf dfinput.cfg
  94. rm -rf dfsound.cfg
  95. rm -rf gxvideo.cfg
  96. rm -rf dfxvideo.cfg
  97. rm -rf gpuPeopsMesaGL.cfg
  98.  
  99.  
  100. # Restore originals cfgs
  101. mv dfcdrom.cfg.bak dfcdrom.cfg
  102. mv dfinput.cfg.bak dfinput.cfg
  103. mv dfsound.cfg.bak dfsound.cfg
  104. mv gxvideo.cfg.bak gxvideo.cfg
  105. mv dfxvideo.cfg.bak dfxvideo.cfg
  106. mv gpuPeopsMesaGL.cfg.bak gpuPeopsMesaGL.cfg
  107. echo " STEP 06 - Restoring original config files "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement