Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. #!/bin/sh
  2. ## Uncomment one or all of the following if you need to find some information about the emulator or roms
  3. ## Name of the emulator
  4. echo "1 is "$1 >> /dev/shm/runcommand.log
  5.  
  6. ## Name of the software used for running the emulation
  7. echo "2 is "$2 >> /dev/shm/runcommand.log
  8.  
  9. ## Name of the rom
  10. echo "3 is "$3 >> /dev/shm/runcommand.log
  11.  
  12. ##Executed command line
  13. #echo $4 >> /dev/shm/runcommand.log
  14.  
  15. ## Find the Retroflag Joystick name
  16. joystick=`find /dev/input/by-id/ -name "*event-joystick*"`
  17. echo "Detected joystick as: "$joystick >> /dev/shm/runcommand.log
  18.  
  19.  
  20.  
  21. ### The FUN begins
  22. #Get ROM name striping full path
  23. rom="${3##*/}"
  24.  
  25. echo "rom is "$rom >> /dev/shm/runcommand.log
  26.  
  27.  
  28. ### Set variables for your joypad and emulator
  29. ### Basic Configuraions - Standard controller mappings
  30. basicGPI="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
  31. --evdev $joystick \
  32. --detach-kernel-driver \
  33. --silent \
  34. --force-feedback \
  35. --deadzone-trigger 15% \
  36. --deadzone 4000 \
  37. --mimic-xpad \
  38. --dpad-as-button \
  39. --trigger-as-button \
  40. --no-extra-events \
  41. --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \
  42. --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TRIGGER_HAPPY4=dd,BTN_TRIGGER_HAPPY1=dl,BTN_TRIGGER_HAPPY2=dr \
  43. --evdev-absmap ABS_X=dpad_x,ABS_Y=dpad_y \
  44. --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y"
  45.  
  46.  
  47. ### Extended Configurations
  48. ### Specific emulator configuration or any other parameters you will need only for some emulators
  49.  
  50. #Outrun Engine
  51. cannonball="--ui-buttonmap x=KEY_V,a=KEY_B,b=KEY_A,Y=KEY_G \
  52. --ui-buttonmap start=KEY_ENTER,back=KEY_1,back+start=KEY_ESC \
  53. --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT"
  54.  
  55. #Streets of Rage remix
  56. sorr="--ui-buttonmap x=KEY_V,a=KEY_S,b=KEY_C,Y=KEY_X,lb=KEY_D,rb=KEY_B,lb+rb=KEY_A,rb+lb=KEY_A \
  57. --ui-buttonmap start=KEY_ENTER,back=KEY_ESC \
  58. --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT"
  59.  
  60. eduke32="--ui-buttonmap x=KEY_RIGHTCTRL,a=KEY_E,b=KEY_SPACE,y=KEY_LEFTSHIFT,lb=KEY_A,rb=KEY_D,a+lb=KEY_SEMICOLON,a+rb=KEY_APOSTROPHE,lb+rb=KEY_LEFTCTRL,rb+lb=KEY_LEFTCTRL \
  61. --ui-buttonmap start=KEY_ENTER+KEY_M,back=KEY_ESC,back+start=KEY_F10 \
  62. --ui-buttonmap du=KEY_UP+KEY_W,du+a=rel:REL_Y:-5:5,a+du=rel:REL_Y:-5:5,dd=KEY_DOWN+KEY_S,dd+a=rel:REL_Y:5:5,a+dd=rel:REL_Y:5:5,dl=KEY_LEFT,dr=KEY_RIGHT \
  63. --ui-buttonmap start+y=KEY_J,start+b=KEY_N,start+x=KEY_H,start+a=KEY_TAB"
  64.  
  65. dosbox="--ui-buttonmap back+start=KEY_ESC \ "
  66.  
  67. minecraft="--ui-buttonmap x=KEY_X:KEY_E:1000,a=KEY_LEFTSHIFT,b=KEY_SPACE,lb=BTN_LEFT,y+lb=rel:REL_WHEEL:1:250,rb=BTN_RIGHT,y+rb=rel:REL_WHEEL:-1:250 \
  68. --ui-buttonmap back=KEY_ESC,start=KEY_ENTER,back+start=exec:/opt/retropie/supplementary/xboxdrv/bin/quit.sh \
  69. --ui-buttonmap du=KEY_W,y+du=rel:REL_Y:-2:5,dd=KEY_S,y+dd=rel:REL_Y:2:5,dl=KEY_A,y+dl=rel:REL_X:-2:5,dr=KEY_D,y+dr=rel:REL_X:2:5"
  70.  
  71. fourway="--four-way-restrictor"
  72.  
  73. invert="--ui-buttonmap du=KEY_DOWN,dd=KEY_UP"
  74.  
  75.  
  76. ### Kill Command
  77. xboxkill="sudo killall xboxdrv > /dev/null 2>&1"
  78.  
  79. ### Execute the driver with the configuration you need
  80. # $2 is the name of the core
  81. case $2 in
  82.  
  83. dosbox)
  84. case $rom in
  85. "test1.zip"|"test2.zip"|"test3.zip") # Configuration used only for these ROMs
  86. $xboxkill
  87. joycommand="$basicGPI $dosbox &"
  88. eval $joycommand
  89. ;;
  90. *) # Configuration for every other ROMs on this emulator
  91. $xboxkill
  92. joycommand="$basicGPI $dosbox &"
  93. eval $joycommand
  94. ;;
  95. esac
  96. ;;
  97.  
  98. eduke32)
  99. $xboxkill
  100. joycommand="$basicGPI $eduke32 &"
  101. eval $joycommand
  102. ;;
  103.  
  104. sorr)
  105. $xboxkill
  106. joycommand="$basicGPI $sorr &"
  107. eval $joycommand
  108. ;;
  109.  
  110. cannonball)
  111. $xboxkill
  112. joycommand="$basicGPI $cannonball &"
  113. eval $joycommand
  114. ;;
  115.  
  116. minecraft)
  117. $xboxkill
  118. joycommand="$basicGPI $minecraft &"
  119. eval $joycommand
  120. ;;
  121.  
  122. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement