Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Layout Incorrect on PS3 #4

Open
0x64c opened this issue May 1, 2017 · 7 comments
Open

Button Layout Incorrect on PS3 #4

0x64c opened this issue May 1, 2017 · 7 comments

Comments

@0x64c
Copy link

0x64c commented May 1, 2017

When plugged into a PS3, the joysticks and L1/R1 are mapped correctly, but the button layout is as follows:
Down: Start
Up: Select
Left: R3
Right: L3
Cross: Square
Circle: Cross
Square: Circle
Select: L2
Start: R2

It would also be a good idea to add rear touch panel support (for users with a grip such as the hori-143 which adds L2/L3/R2/R3 triggers)

@xerpi
Copy link
Owner

xerpi commented May 1, 2017

Can you try with this version and tell me if the button layout is better, and if not what's wrong?

https://transfer.sh/vrZZx/vitastick.skprx

@0x64c
Copy link
Author

0x64c commented May 1, 2017

This layout is better; although the triggers are now mapped to L2/R2 instead of L1/R1; but I guess that doesn't really matter if the rear touchpad isn't implemented yet. The D-Pad also still doesn't work.

I actually played around with the code earlier; I could get it to map to any button on the ps3 controller except for the dpad, for some reason. Values 1<<12 to 1<<15 don't seem to do anything.

static void fill_gamepad_report(const SceCtrlData *pad, struct gamepad_report_t *gamepad)
{
	gamepad->report_id = 1;
	gamepad->buttons = 0;
/* PS3 Bindings
0	Square
1	Cross
2	Circle
3	Triangle
4	L1
5	R1
6	L2
7	R2
8	Select
9	Start
10	L3
11	R3
?	Up
?	Down
?	Left
?	Right
*/
	if (pad->buttons & SCE_CTRL_CROSS)
		gamepad->buttons |= 1 << 1;
	if (pad->buttons & SCE_CTRL_CIRCLE)
		gamepad->buttons |= 1 << 2;
	if (pad->buttons & SCE_CTRL_SQUARE)
		gamepad->buttons |= 1 << 0;
	if (pad->buttons & SCE_CTRL_TRIANGLE)
		gamepad->buttons |= 1 << 3;
	if (pad->buttons & SCE_CTRL_LTRIGGER)
		gamepad->buttons |= 1 << 4;
	if (pad->buttons & SCE_CTRL_RTRIGGER)
		gamepad->buttons |= 1 << 5;
/*	if (pad->buttons & SCE_CTRL_L1)
		gamepad->buttons |= 1 << 6;
	if (pad->buttons & SCE_CTRL_R1)
		gamepad->buttons |= 1 << 7;*/
	if (pad->buttons & SCE_CTRL_SELECT)
		gamepad->buttons |= 1 << 8;
	if (pad->buttons & SCE_CTRL_START)
		gamepad->buttons |= 1 << 9;
/*	if (pad->buttons & SCE_CTRL_L3)
		gamepad->buttons |= 1 << 10;
	if (pad->buttons & SCE_CTRL_R3)
		gamepad->buttons |= 1 << 11;*/
	gamepad->left_x = (int8_t)pad->lx - 128;
	gamepad->left_y = (int8_t)pad->ly - 128;
	gamepad->right_x = (int8_t)pad->rx - 128;
	gamepad->right_y = (int8_t)pad->ry - 128;
}

@MotoLegacy
Copy link

Bump as this still isn't solved. No right stick Y axis support nor dpad/POV support as a whole.

@xerpi
Copy link
Owner

xerpi commented Jul 25, 2018

@MotoLegacy Can you try the latest release?

@mochiman
Copy link

After updating the the newest release the buttons appear to be mapped correctly (X,O,square,triangle,start,select) and the right stick works (haven't gotten a chance to test the left stick). Unfortunately the DPad is still wholly unresponsive. On alpha 0.3 down on the DPAD acted as START and up acted as DPAD down. Thanks for the work btw!

@xerpi
Copy link
Owner

xerpi commented Aug 18, 2018

Oh I think I know what's going on, the PS3 wants the DPad to be treated as an axis: https://forum.unity.com/threads/ps3-button-map.89288/

@mochiman
Copy link

Are you considering implementing that as a feature or possibly as a separate homebrew?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants