Skip to content

5.b Controller | Configurate the Dualshock 3 controller

Maschell edited this page Apr 10, 2017 · 4 revisions

Overview

The controller patcher engine has built in support for the offical Dualshock 3 controller for the Playstation 3. The need to connect it via USB.

Default button mapping

When you provide no config file, the following button mapping will be used:

Gamepad A                   =   DS3 circle button
Gamepad B                   =   DS3 cross button
Gamepad X                   =   DS3 triangle button
Gamepad Y                   =   DS3 square button

Gamepad DPAD                =   DS3 Dpad
Gamepad left stick          =   DS3 left stick
Gamepad right stick         =   DS3 right stick

Gamepad Plus                =   DS3 START button
Gamepad Minus               =   DS3 select button

Gamepad L                   =   DS3 L1
Gamepad R                   =   DS3 R1

Gamepad ZL                  =   DS3 L2 button
Gamepad ZR                  =   DS3 R2 button

Gamepad Left stick press    =   DS3 L3 (left stick press)
Gamepad right stick press   =   DS3 R3 (right stick press)

Configfile

Identify line

The vid of the dualshock 3 is "0x054c", the pid "0x0268". The identify is this:

[vid=0x054c,pid=0x0268]

Ignoring default values

You can either complety overwrite the default configuration or just modifying parts of it. When you put the following as the **second **line in the config, the default values will be ignored.

[IgnoreDefault]

Configuration

Setting the buttons

Like metioned earlier in this wiki, the built in controller have an "easy" way to map the buttons and sticks. The following buttons and trigger can be mapped:

Buttons:
A                   =   VPAD_BUTTON_A
B                   =   VPAD_BUTTON_B
X                   =   VPAD_BUTTON_X
Y                   =   VPAD_BUTTON_Y
Plus                =   VPAD_BUTTON_PLUS
Minus               =   VPAD_BUTTON_MINUS
Home                =   VPAD_BUTTON_HOME
Sync                =   VPAD_BUTTON_SYNC
TV                  =   VPAD_BUTTON_TV

DPAD:
DPAD left           =   VPAD_BUTTON_LEFT
DPAD left           =   VPAD_BUTTON_RIGHT
DPAD left           =   VPAD_BUTTON_UP
DPAD left           =   VPAD_BUTTON_DOWN

Trigger:
ZR                  =   VPAD_BUTTON_ZR
ZL                  =   VPAD_BUTTON_ZL
L                   =   VPAD_BUTTON_L
R                   =   VPAD_BUTTON_R

Sticks:
Stick press left    =   VPAD_BUTTON_STICK_L
Stick press right   =   VPAD_BUTTON_STICK_R

These can be mapped to the following GC Buttons:

//Buttons
DS3 Cross            =   DS3_BUTTON_CROSS
DS3 Circle           =   DS3_BUTTON_CIRCLE
DS3 Square           =   DS3_BUTTON_SQUARE
DS3 Triangle         =   DS3_BUTTON_TRIANGLE
DS3 Start            =   DS3_BUTTON_START
DS3 Select           =   DS3_BUTTON_SELECT
DS3 Guide button     =   DS3_BUTTON_GUIDE

//DPAD
DS3 DPAD Left    =   DS3_BUTTON_LEFT
DS3 DPAD Right   =   DS3_BUTTON_RIGHT
DS3 DPAD Down    =   DS3_BUTTON_DOWN
DS3 DPAD Up      =   DS3_BUTTON_UP

//Trigger
DS3 L1           =   DS3_BUTTON_L1
DS3 L2           =   DS3_BUTTON_L2
DS3 L3           =   DS3_BUTTON_L3

DS3 R1           =   DS3_BUTTON_R1
DS3 R2           =   DS3_BUTTON_R2
DS3 R3           =   DS3_BUTTON_R3

Setting the DPAD

In order to able to use the DPAD in config, the dpad mode needs to be set. The a predefined value that can be used.

DPAD_MODE        =   DS3_DPAD_MODE

Setting the Sticks

The gamepad has two sticks with axis that can be mapped to the dualshock controller:

Gamepad left stick, X Axis      =   VPAD_BUTTON_L_STICK_X
Gamepad left stick, Y Axis      =   VPAD_BUTTON_L_STICK_Y
Gamepad right stick, X Axis     =   VPAD_BUTTON_R_STICK_X
Gamepad right stick, Y Axis     =   VPAD_BUTTON_R_STICK_Y

The dualshock controller has predefines values that can be used.

Dualshock 3 left stick, X Axis  =   DS3_STICK_L_X
Dualshock 3 left stick, Y Axis  =   DS3_STICK_L_Y
Dualshock 3 right stick, X Axis =   DS3_STICK_R_X
Dualshock 3 right stick, Y Axis =   DS3_STICK_R_Y

Default Stick Values

Each axis of each stick has his own neutral/min/max value,deadzone and can be inverted. These are the default values for the GC controller sticks:

Dualshock 3 left stick, X Axis     =       Neutral: 0x80, Min: 0x00, Max: 0xFF, Deadzone: 0x06, inverted: no
Dualshock 3 left stick, Y Axis     =       Neutral: 0x80, Min: 0x00, Max: 0xFF, Deadzone: 0x06, inverted: yes
Dualshock 3 right stick, X Axis    =       Neutral: 0x80, Min: 0x00, Max: 0xFF, Deadzone: 0x06, inverted: no
Dualshock 3 right stick, Y Axis    =       Neutral: 0x80, Min: 0x00, Max: 0xFF, Deadzone: 0x06, inverted: yes

Adjusting Stick values

Each value (exept the neutral postision) can be adjusting through the config file. NOTE: When you use the VPAD_BUTTON_L_STICK_X, VPAD_BUTTON_L_STICK_Y, VPAD_BUTTON_R_STICK_X, VPAD_BUTTON_R_STICK_Y to change/set the sticks, use the following options only AFTER them.


To change the value for the min/max value use a line simliar like this:

VPAD_L_STICK_X_MINMAX        =   0x01,0xFE

In this example you would change the values of left stick X axis. The min value is set to 0x01, the max value to 0xFE. This works similar for other gamepad sticks/axis


To change the value for the deadzone use a line simliar like this:

VPAD_L_STICK_X_DEADZONE      =   0x07

In this example you would change the deadzone of left stick X axis. The deadzone is set to 0x09.


To change the value for the deadzone use a line simliar like this:

VPAD_L_STICK_X_INVERT       =   true

In this example you would invert the left stick X axis. When you don't want to invert it, you can set the value to "no" or "false".


Examples

Example 1

Keeping the default settings, just adjust the deadzones of left stick.

[vid=0x054c,pid=0x0268]
VPAD_L_STICK_X_DEADZONE      =   0x10
VPAD_L_STICK_Y_DEADZONE      =   0x11

Example 2

Keeping the default settings, just don't invert the Y axis of right stick.

[vid=0x054c,pid=0x0268]
VPAD_R_STICK_Y_INVERT      =   no

Example 3

Overwriting the default setting. Loading the default setting completly from the config

[vid=0x054c,pid=0x0268]
[IgnoreDefault] //Ignoring the built in default values

//Settings buttons 
VPAD_BUTTON_A                   =   DS3_BUTTON_CIRCLE
VPAD_BUTTON_B                   =   DS3_BUTTON_CROSS
VPAD_BUTTON_X                   =   DS3_BUTTON_TRIANGLE
VPAD_BUTTON_Y                   =   DS3_BUTTON_SQUARE
VPAD_BUTTON_MINUS               =   DS3_BUTTON_SELECT
VPAD_BUTTON_PLUS                =   DS3_BUTTON_START

VPAD_BUTTON_STICK_L             =   DS3_BUTTON_L3
VPAD_BUTTON_STICK_R             =   DS3_BUTTON_R3

//Setting dpad
DPAD_MODE                       =   DS3_DPAD_MODE
VPAD_BUTTON_LEFT                =   DS3_BUTTON_LEFT
VPAD_BUTTON_RIGHT               =   DS3_BUTTON_RIGHT
VPAD_BUTTON_UP                  =   DS3_BUTTON_UP
VPAD_BUTTON_DOWN                =   DS3_BUTTON_DOWN

//Setting the sticks
VPAD_L_STICK_X                  =   DS3_STICK_L_X
VPAD_L_STICK_Y                  =   DS3_STICK_L_Y
VPAD_R_STICK_X                  =   DS3_STICK_R_X
VPAD_R_STICK_Y                  =   DS3_STICK_R_Y

//Setting the trigger
VPAD_BUTTON_L                   =   DS3_BUTTON_L1
VPAD_BUTTON_ZL                  =   DS3_BUTTON_L2
VPAD_BUTTON_R                   =   DS3_BUTTON_R1
VPAD_BUTTON_ZR                  =   DS3_BUTTON_R2
//This device is no adapter that can have more than 1 pads.
PAD_COUNT                       =   0x01