Skip to content

5.a Controller | Configurate the GameCube controller

Maschell edited this page Apr 10, 2017 · 4 revisions

Overview

The controller patcher engine has built in support for the offical gamecube controller adapter that was made for Super Smash Bros. WiiU.

Default button mapping

The gamecube controller has less buttons than the gamepad.
The Controller has

  • only "start" but no "minus" and "plus"
  • only R/L but no ZR/ZL
  • the sticks have no built in button

As a workarround, some buttons will can act as 2 different buttons. When the "Z" button is hold down while pressing Start, "minus" is emulated without it "plus".

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

Gamepad A                   =   GC A button
Gamepad B                   =   GC B button
Gamepad X                   =   GC X button
Gamepad Y                   =   GC Y button

Gamepad DPAD                =   GC Dpad
Gamepad left stick          =   GC left stick
Gamepad right stick         =   GC right stick

Gamepad Plus                =   GC START button
Gamepad Minus               =   GC START button + GC Z button

Gamepad L                   =   GC L button + GC Z button
Gamepad R                   =   GC R button + GC Z button

Gamepad ZL                  =   GC L button
Gamepad ZR                  =   GC R button

Gamepad Left stick press    =   GC A button + GC Z button
Gamepad right stick press   =   GC B button + GC Z button

Configfile

Identify line

The vid of the official gc-adapter is "0x057e", the pid "0x0337". The identify is this:

[vid=0x057e,pid=0x0337]

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
GC A            =   GC_BUTTON_A
GC B            =   GC_BUTTON_B
GC X            =   GC_BUTTON_X
GC Y            =   GC_BUTTON_Y
GC start        =   GC_BUTTON_START
GC Z            =   GC_BUTTON_Z

//DPAD
GC DPAD left    =   GC_BUTTON_LEFT
GC DPAD right   =   GC_BUTTON_RIGHT
GC DPAD down    =   GC_BUTTON_DOWN
GC DPAD up      =   GC_BUTTON_UP

//Trigger
GC L            =   GC_BUTTON_L
GC R            =   GC_BUTTON_R

Setting the DPAD

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

DPAD_MODE      =   GC_DPAD_MODE

Setting the Sticks

The gamepad has two sticks with axis that can be mapped to the gamecube 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 gamecube controller has predefines values that can be used.

Gamecube left stick, X Axis      =   GC_STICK_L_X
Gamecube left stick, Y Axis      =   GC_STICK_L_Y
Gamecube right stick, X Axis     =   GC_STICK_R_X
Gamecube right stick, Y Axis     =   GC_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:

Gamecube left stick, X Axis     =       Neutral: 0x80, Min: 0x1E, Max: 0xE5, Deadzone: 0x09, inverted: no
Gamecube left stick, Y Axis     =       Neutral: 0x80, Min: 0x18, Max: 0xE1, Deadzone: 0x09, inverted: no
Gamecube right stick, X Axis    =       Neutral: 0x80, Min: 0x26, Max: 0xE1, Deadzone: 0x09, inverted: no
Gamecube right stick, Y Axis    =       Neutral: 0x80, Min: 0x1A, Max: 0xDB, Deadzone: 0x09, inverted: no

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        =   0x1E,0xE5

In this example you would change the values of left stick X axis. The min value is set to 0x1E, the max value to 0xE5. 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      =   0x09

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".


Changing the double-used buttons

Activate the double using:

DOUBLE_USE                 =   true

To use the other value of a button, a buttons need to be pressed. This acts like a button activator.
Every Gamecube button can be used for this.

DOUBLE_USE_BUTTON_ACTIVATOR     =   GC_BUTTON_Z

In this case the mode of some button is changed when the Z button is pressed.


For the gamecube controller 5 buttons can have 2 different values. To configure them, you need set both values. One value that will be used when activator is pressed, the other when to activator is not pressed. Example for double using start/r an in the default configuration:

//Acitvate double using
DOUBLE_USE                      =    true
DOUBLE_USE_BUTTON_ACTIVATOR     =    GC_BUTTON_Z

//Setting the buttons normaly (both set to start)
VPAD_BUTTON_PLUS                =   GC_BUTTON_START
VPAD_BUTTON_MINUS               =   GC_BUTTON_START
//define which button will be used at which point
DOUBLE_USE_BUTTON_1_PRESSED     =   VPAD_BUTTON_MINUS //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_1_RELASED     =   VPAD_BUTTON_PLUS //Value when the acitvator is released

//Setting the buttons normaly (both set to R)
VPAD_BUTTON_R                  =   GC_BUTTON_R
VPAD_BUTTON_ZR                 =   GC_BUTTON_R
//define which button will be used at which point
DOUBLE_USE_BUTTON_2_PRESSED     =   VPAD_BUTTON_ZR //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_2_RELASED     =   VPAD_BUTTON_R //Value when the acitvator is released

The default config has used the slots in the following way, you may need it when you just want to change parts of it:

DOUBLE_USE_BUTTON_1_PRESSED     =     VPAD_BUTTON_MINUS
DOUBLE_USE_BUTTON_1_RELASED     =     VPAD_BUTTON_PLUS

DOUBLE_USE_BUTTON_2_PRESSED     =     VPAD_BUTTON_L
DOUBLE_USE_BUTTON_2_RELASED     =     VPAD_BUTTON_ZL

DOUBLE_USE_BUTTON_3_PRESSED     =     VPAD_BUTTON_R
DOUBLE_USE_BUTTON_3_RELASED     =     VPAD_BUTTON_ZR

DOUBLE_USE_BUTTON_4_PRESSED     =     VPAD_BUTTON_STICK_L
DOUBLE_USE_BUTTON_4_RELASED     =     VPAD_BUTTON_STICK_L

DOUBLE_USE_BUTTON_5_PRESSED     =     VPAD_BUTTON_STICK_R
DOUBLE_USE_BUTTON_5_RELASED     =     VPAD_BUTTON_STICK_R

Examples

Example 1

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

[vid=0x057e,pid=0x0337]
VPAD_L_STICK_X_DEADZONE      =   0x10
VPAD_L_STICK_Y_DEADZONE      =   0x10

Example 2

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

[vid=0x057e,pid=0x0337]
VPAD_R_STICK_Y_INVERT      =   true

Example 3

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

[vid=0x057e,pid=0x0337]
[IgnoreDefault] //Ignoring the built in default values

//Settings buttons that are not double used
VPAD_BUTTON_X                   =    GC_BUTTON_X
VPAD_BUTTON_Y                   =    GC_BUTTON_Y

//Setting dpad
DPAD_MODE                       =    GC_DPAD_MODE
VPAD_BUTTON_LEFT                =    GC_BUTTON_LEFT
VPAD_BUTTON_RIGHT               =    GC_BUTTON_RIGHT
VPAD_BUTTON_UP                  =    GC_BUTTON_UP
VPAD_BUTTON_DOWN                =    GC_BUTTON_DOWN

//Setting the sticks
VPAD_L_STICK_X           =    GC_STICK_L_X
VPAD_L_STICK_Y           =    GC_STICK_L_Y
VPAD_R_STICK_X           =    GC_STICK_R_X
VPAD_R_STICK_Y           =    GC_STICK_R_Y

//Acitvate double using
DOUBLE_USE                      =    true
DOUBLE_USE_BUTTON_ACTIVATOR     =    GC_BUTTON_Z


//Setting buttons for GC START
VPAD_BUTTON_PLUS                =   GC_BUTTON_START
VPAD_BUTTON_MINUS               =   GC_BUTTON_START

//define which button will be used at which state
DOUBLE_USE_BUTTON_1_PRESSED     =   VPAD_BUTTON_MINUS //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_1_RELASED     =   VPAD_BUTTON_PLUS //Value when the acitvator is released


//Setting buttons for GC R
VPAD_BUTTON_R                  =    GC_BUTTON_R
VPAD_BUTTON_ZR                 =    GC_BUTTON_R

//define which button will be used at which state
DOUBLE_USE_BUTTON_2_PRESSED     =   VPAD_BUTTON_ZR //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_2_RELASED     =   VPAD_BUTTON_R //Value when the acitvator is released


//Setting buttons for GC L
VPAD_BUTTON_L                  =    GC_BUTTON_L
VPAD_BUTTON_ZL                 =    GC_BUTTON_L

//define which button will be used at which state
DOUBLE_USE_BUTTON_3_PRESSED     =   VPAD_BUTTON_ZR //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_3_RELASED     =   VPAD_BUTTON_R //Value when the acitvator is released


//Setting buttons for GC A
VPAD_BUTTON_A                  =    GC_BUTTON_A
VPAD_BUTTON_STICK_L            =    GC_BUTTON_A

//define which button will be used at which state
DOUBLE_USE_BUTTON_4_PRESSED     =   VPAD_BUTTON_STICK_A //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_4_RELASED     =   VPAD_BUTTON_STICK_L //Value when the acitvator is released


//Setting buttons for GC B
VPAD_BUTTON_B                  =    GC_BUTTON_B
VPAD_BUTTON_STICK_R            =    GC_BUTTON_B

//define which button will be used at which state
DOUBLE_USE_BUTTON_5_PRESSED     =   VPAD_BUTTON_STICK_B //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_5_RELASED     =   VPAD_BUTTON_STICK_R //Value when the acitvator is released

//The adapter has 4 ports.
PAD_COUNT                       =   0x04

Example 4

Keeping the default settings, just swap the double use of GC A and GC B. After this config:

  • GC A + GC Z result in GamePad right stick press
  • GC B + GC Z result in GamePad left stick press (Double use slot 4 and 5 are use in the default configuration. We need to use them here too)
[vid=0x057e,pid=0x0337]
//Setting buttons for GC A
VPAD_BUTTON_STICK_R            =    GC_BUTTON_A

//define which button will be used at which state
DOUBLE_USE_BUTTON_4_PRESSED     =   VPAD_BUTTON_STICK_A //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_4_RELASED     =   VPAD_BUTTON_STICK_R //Value when the acitvator is released


//Setting buttons for GC B
VPAD_BUTTON_STICK_L            =    GC_BUTTON_B

//define which button will be used at which state
DOUBLE_USE_BUTTON_5_PRESSED     =   VPAD_BUTTON_STICK_B //Value when the acitvator is pressed
DOUBLE_USE_BUTTON_5_RELASED     =   VPAD_BUTTON_STICK_L //Value when the acitvator is released