Skip to content

Instantly share code, notes, and snippets.

@bremme
Last active November 29, 2016 02:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bremme/d99400f655cfc78932bb to your computer and use it in GitHub Desktop.
Save bremme/d99400f655cfc78932bb to your computer and use it in GitHub Desktop.
ePSXe configuration and scripts
#!/bin/bash
#
# pad-1-5-chillstream -- this script is used to configure two Logitech Chillstream controllers for use with ePSXe (1.9) through wine connected to port 1 (player 1) and port 5 (player 2).
#
# Copyright (C) 2014 Bram Harmsen
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Dependency: wine
# define the wine prefix
PREFIX="/home/bremme/.PlayOnLinux/wineprefix/emulator"
# get the directory of this script
DIR="$( cd "$( dirname "$0" )" && pwd )"
# write a temp reg file with the right registery keys
echo 'REGEDIT4
[HKEY_CURRENT_USER\Software\epsxe\config]
"GamepadBMotorType"="0,0,0,0,0,0,0,0"
"GamepadFullAxis"="0,1,3,4,192,192,192,192,192,192,192,192,192,192,192,192,8,9,11,12,192,192,192,192,192,192,192,192,192,192,192,192"
"GamepadMotorType"="0,0,0,0,0,0,0,0"
"GamepadRange"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"GamepadSMotorType"="0,0,0,0,0,0,0,0"
"GamepadSubType"="0,0,0,0,0,0,0,0"
"GamepadType"="5,1,1,1,5,1,1,1"
"Multitap1"="0"
"Multitap2"="0"
"Pad1"="515,513,512,514,275,273,272,274,276,260,277,261,279,278,281,282"
"Pad2"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad3"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad4"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad5"="547,545,544,546,307,305,304,306,308,292,309,297,311,310,313,314"
"Pad6"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad7"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad8"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"' > "$DIR/temp.reg"
# update the registry using the temp reg file
WINEPREFIX="$PREFIX" wine regedit "$DIR/temp.reg"
# remove the temp reg file
rm "$DIR/temp.reg"
#!/bin/bash
#
# pad-1-5-chillstream-6-7-senze -- this script is used to configure two Logitech Chillstream plus two Senze (DX playstation two) controllers for use with ePSXe (1.9) through wine connected to port 1 (player 1),port 5 (player 2), port 6 (player 3) and port 7 (player 4).
#
# Copyright (C) 2014 Bram Harmsen
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Dependency: wine
# define the wine prefix
PREFIX="/home/bremme/.PlayOnLinux/wineprefix/emulator"
# get the directory of this script
DIR="$( cd "$( dirname "$0" )" && pwd )"
# write a temp reg file with the right registery keys
echo 'REGEDIT4
[HKEY_CURRENT_USER\Software\epsxe\config]
"GamepadBMotorType"="0,0,0,0,0,0,0,0"
"GamepadFullAxis"="0,1,3,4,192,192,192,192,192,192,192,192,192,192,192,192,8,9,11,12,16,17,18,19,24,25,26,27,192,192,192,192"
"GamepadMotorType"="0,0,0,0,0,0,0,0"
"GamepadRange"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"GamepadSMotorType"="0,0,0,0,0,0,0,0"
"GamepadSubType"="0,0,0,0,0,0,0,0"
"GamepadType"="5,1,1,1,5,5,5,1"
"Multitap1"="0"
"Multitap2"="1"
"Pad1"="515,513,512,514,275,273,272,274,276,260,277,261,279,278,281,282"
"Pad2"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad3"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad4"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
"Pad5"="547,545,544,546,307,305,304,306,308,292,309,297,311,310,313,314"
"pad6"="579,577,576,578,336,337,338,339,340,342,341,343,345,344,346,347"
"pad7"="611,609,608,610,368,369,370,371,372,374,373,375,377,376,378,379"
"Pad8"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"' > "$DIR/temp.reg"
# update the registry using the temp reg file
WINEPREFIX="$PREFIX" wine regedit "$DIR/temp.reg"
# remove the temp reg file
rm "$DIR/temp.reg"
@bremme
Copy link
Author

bremme commented Aug 23, 2014

Some notes on how ePSXe determines the values of "Pad#" and "GamepadFullAxes". The values of "Pad3" are dependent on the type of gamepad/joystick in combination with mount point (i.e. /dev/input/js0). The same gamepad/joystick connected trough the same mount point will always result in the same numbers.

The values of "GamepadFullAxes" are determined as follows; ePSXe can handle a total of 8 controllers. So for every controller there are four numbers (since there are a total of 32 numbers). If a port is empty this results in: 192,192,192,192. If a port is occupied, the four numbers correspond to the axes of the gamepad/joystick which are mapped to: left stick horizontal, left stick vertical, right stick horizontal, right stick vertical (in this exact order) and increased by the connected pad number minus one, times 8. To give an example:

Pad3 and Pad 5 are connected
the corresponding axes are 0,1,3,4 and 0,1,2,3
192,192,192,192, 192,192,192,192, 0,1,3,4, 192,192,192,192, 8,9,10,11 192,192,192,192, 192,192,192,192, 192,192,192,192,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment