Skateboard Peripheral

From PS3 Developer wiki
Jump to navigation Jump to search
prototype of TH:Ride board

the two types of boards

The Tony Hawk: RIDE \ SHRED skateboard is a peripheral that launched in 2009 for ps3,xbox 360 and wii

i have collected some info that i would like to preserve. this info was mainly used in this PR to RPCS3: https://github.com/RPCS3/rpcs3/pull/14619

The game looks for data in cellPadGetData and cellPadGetInfo2.

For the game to detect a controller as a skate board the data in cellPadGetInfo2. needs to be:

now_connect = 1 (is the controller connected)

system_info = 0 (??? never seen it not be 0)

port_status = 1

port_setting = 6 (set by the game by calling (cellPadSetPortSetting(port_num, 6) )

device_capabillity = 7 (describes that it has motion etc)

device_type = 0 (no idea)

cellPadGetData is a function that is called when a game wants to get input from a controller. it ruturnes an pointer to a padData structure.

typedef struct CellPadData {

    int32_t len;

    uint16_t button[CELL_PAD_MAX_CODES (=64)];

}


inside the button array we have 64 bytes. ill explain them all in the context of the skateboard

Offset (words) Content Definition
0 0x0000 -
1 bits 15 – 8: Reserved

bits 7 – 4: 0x7 fixed bits 3 – 0: len /2

-
2 Digital button statuses (definitions)

0: release, 1: push   bits 8 – 15: Reserved   bit7: Left button (CELL_PAD_CTRL_LEFT)   bit6: Down button (CELL_PAD_CTRL_DOWN)   bit5: Right button (CELL_PAD_CTRL_RIGHT)   bit4: Up button (CELL_PAD_CTRL_UP)   bit3: START button (CELL_PAD_CTRL_START)   bit2: R3 button (CELL_PAD_CTRL_R3)   bit1: L3 button (CELL_PAD_CTRL_L3)   bit0: SELECT button (CELL_PAD_CTRL_SELECT)

CELL_PAD_BTN_OFFSET_DIGITAL1
3 Digital button statuses (definitions)

0: release, 1: push   bits 8 – 15: Reserved   bit7: Square button (CELL_PAD_CTRL_SQUARE)   bit6: Cross button (CELL_PAD_CTRL_CROSS)   bit5: Circle button (CELL_PAD_CTRL_CIRCLE)   bit4: Triangle button (CELL_PAD_CTRL_TRIANGLE)   bit3: R1 button (CELL_PAD_CTRL_R1)   bit2: L1 button (CELL_PAD_CTRL_L1)   bit1: R2 button (CELL_PAD_CTRL_R2)   bit0: L2 button (CELL_PAD_CTRL_L2)

CELL_PAD_BTN_OFFSET_DIGITAL2
4 Right stick (X direction) Left 0x0000 – Right 0x00FF CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_X

skateboard will always report 128

5 Right stick (Y direction) Up 0x0000 – Down 0x00FF CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_Y
6 Left stick (X direction) Left 0x0000 Right 0x00FF CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X

skateboard will always report 128

7 Left stick (Y direction) Up 0x0000 – Down 0x00FF CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y
8 Pressure-sensitive information (Right) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_RIGHT
9 Pressure-sensitive information (Left) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_LEFT
10 Pressure-sensitive information (Up) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_UP
11 Pressure-sensitive information (Down) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_DOWN
12 Pressure-sensitive information (Triangle) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_TRIANGLE

IR sensor on the nose of the board expected values: 0-64, IRL values 7-55

13 Pressure-sensitive information (Circle) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_CIRCLE

IR sensor on the tail of the board expected values: 0-64, IRL values 7-55

14 Pressure-sensitive information (Cross) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_CROSS

IR sensor on the left of the board expected values: 0-64, IRL values 7-55

15 Pressure-sensitive information (Square) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_SQUARE

IR sensor on the right of the board expected values: 0-64, IRL values 7-55

16 Pressure-sensitive information (L1) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_L1

over tilt detection. normal value reported is 6-9 if board is tilted too much it will be 10-55 has to be 6-9 in main menu to be recognized as a skateboard

17 Pressure-sensitive information (R1) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_R1

over tilt detection. normal value reported is 6-9 if board is tilted too much it will be 10-55 has to be 6-9 in main menu to be recognized as a skateboard

18 Pressure-sensitive information (L2) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_L2
19 Pressure-sensitive information (R2) *

Valid range: 0x0000 - 0x00FF

CELL_PAD_BTN_OFFSET_PRESS_R2
20 Sensor information (X axis) **

Valid range: 0x0000 - 0x03FF

CELL_PAD_BTN_OFFSET_SENSOR_X
21 Sensor information (Y axis) **

Valid range: 0x0000 - 0x03FF

CELL_PAD_BTN_OFFSET_SENSOR_Y
22 Sensor information (Z axis) **

Valid range: 0x0000 - 0x03FF

CELL_PAD_BTN_OFFSET_SENSOR_Z
23 Sensor information (angular rate) **

Valid range: 0x0000 - 0x03FF

CELL_PAD_BTN_OFFSET_SENSOR_G
24 – 63 Reserved -

in summary. for the game to recognize a controller as a skateboard it has to have this:

bytes 4 and 6 have to be 128

bytes 16 and 17 have to be more than 5 and less than 55

that will pass the is skateboard connected check

now you (sadly) have info on this plastic piece of shit

it was fun to understand it and now rpcs3 picks it up :)

heres a bonus image of a prototype board: