Merge pull request #1827 from fewtarius/dev

Fix up CEMU Pro controller bug.
This commit is contained in:
fewtarius 2023-07-26 08:11:17 -04:00 committed by GitHub
commit 745897947a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 146 additions and 9 deletions

View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<emulated_controller>
<type>Wii U Pro Controller</type>
<controller>
<api>SDLController</api>
<uuid>0_030003f05e0400008e02000010010000</uuid>
<display_name>Xbox 360 Controller</display_name>
<rumble>0.15</rumble>
<axis>
<deadzone>0.25</deadzone>
<range>1</range>
</axis>
<rotation>
<deadzone>0.25</deadzone>
<range>1</range>
</rotation>
<trigger>
<deadzone>0.25</deadzone>
<range>1</range>
</trigger>
<mappings>
<entry>
<mapping>25</mapping>
<button>40</button>
</entry>
<entry>
<mapping>13</mapping>
<button>12</button>
</entry>
<entry>
<mapping>12</mapping>
<button>11</button>
</entry>
<entry>
<mapping>11</mapping>
<button>11</button>
</entry>
<entry>
<mapping>10</mapping>
<button>4</button>
</entry>
<entry>
<mapping>9</mapping>
<button>6</button>
</entry>
<entry>
<mapping>8</mapping>
<button>43</button>
</entry>
<entry>
<mapping>7</mapping>
<button>42</button>
</entry>
<entry>
<mapping>6</mapping>
<button>10</button>
</entry>
<entry>
<mapping>5</mapping>
<button>9</button>
</entry>
<entry>
<mapping>4</mapping>
<button>2</button>
</entry>
<entry>
<mapping>3</mapping>
<button>3</button>
</entry>
<entry>
<mapping>24</mapping>
<button>46</button>
</entry>
<entry>
<mapping>23</mapping>
<button>41</button>
</entry>
<entry>
<mapping>22</mapping>
<button>47</button>
</entry>
<entry>
<mapping>21</mapping>
<button>38</button>
</entry>
<entry>
<mapping>20</mapping>
<button>44</button>
</entry>
<entry>
<mapping>19</mapping>
<button>39</button>
</entry>
<entry>
<mapping>18</mapping>
<button>45</button>
</entry>
<entry>
<mapping>17</mapping>
<button>8</button>
</entry>
<entry>
<mapping>16</mapping>
<button>7</button>
</entry>
<entry>
<mapping>15</mapping>
<button>14</button>
</entry>
<entry>
<mapping>2</mapping>
<button>0</button>
</entry>
<entry>
<mapping>14</mapping>
<button>13</button>
</entry>
<entry>
<mapping>1</mapping>
<button>1</button>
</entry>
</mappings>
</controller>
</emulated_controller>

View file

@ -83,11 +83,6 @@ then
mkdir -p ${CEMU_CONFIG_ROOT}/controllerProfiles
fi
if [ ! -e "${CEMU_CONFIG_ROOT}/controllerProfiles/controller0.xml" ]
then
cp /usr/config/Cemu/controllerProfiles/controller0.xml ${CEMU_CONFIG_ROOT}/controllerProfiles/
fi
FILE=$(echo $@ | sed "s#^/.*/##g")
FPS=$(get_setting show_fps wiiu "${FILE}")
CON=$(get_setting wiiu_controller_profile wiiu "${FILE}")
@ -96,10 +91,28 @@ if [ -z "${FPS}" ]
then
FPS="0"
fi
if [ -z "${CON}" ]
then
CON="Wii U GamePad"
fi
case ${CON} in
"Wii U Pro Controller")
CONFILE="wii_u_pro_controller.xml"
CON="Wii U Pro Controller"
;;
*)
### Break these out when possible.
### "Wii U GamePad"|"Wii U Classic Controller"|"Wiimote"
CONFILE="wii_u_gamepad.xml"
CON="Wii U GamePad"
;;
esac
for CONTROLLER in /usr/config/Cemu/controllerProfiles/*
do
LOCALFILE="$(basename ${CONTROLLER})"
if [ "${CONFILE}" = "${LOCALFILE}" ]
then
cp "${CONTROLLER}" "${CEMU_CONFIG_ROOT}/controllerProfiles/controller0.xml"
fi
done
UUID0="0_$(control-gen | awk 'BEGIN {FS="\""} /^DEVICE/ {print $2;exit}')"
CONTROLLER0=$(cat /storage/.controller)