Skip to content

Instantly share code, notes, and snippets.

@samermurad
Created December 6, 2021 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samermurad/67b430168ae959156d829ad74b60a15f to your computer and use it in GitHub Desktop.
Save samermurad/67b430168ae959156d829ad74b60a15f to your computer and use it in GitHub Desktop.
PBTails SDL2 X/Y Triangle/Square Mapping Fix

PBTails Controller mapping fix

https://www.pbtails.com/

This mapping fixes the flipp of the X/Y Triangle/Square buttons on the controller. I needed this fix for game dev and for the PS2 emulator, PCSX2

PCSX2 Fix

insert the following line into the game_controller_db.txt file, on macOS, file can be found: /Applications/PCSX2.app/Contents/Resources

SDL usage

SDL_GameControllerAddMappingsFromFile(/path/to/file)

# Game Controller DB for SDL in 2.0.16 format
# Mac OS X
030000007e0500000920000001006800,Nintendo Switch Pro Controller,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b15,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Mac OS X,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment