@@ -798,6 +798,54 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_GUID guid)
798
798
product == USB_PRODUCT_8BITDO_SF30_PRO_BT )) {
799
799
// This controller has no guide button
800
800
SDL_strlcat (mapping_string , "a:b1,b:b0,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,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,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1," , sizeof (mapping_string ));
801
+ } else if (SDL_IsJoystickSInputController (vendor , product )) {
802
+ Uint8 face_style = (guid .data [15 ] & 0xF0 ) >> 4 ;
803
+ Uint8 u_id = guid .data [15 ] & 0x0F ;
804
+
805
+ switch (product ) {
806
+ case USB_PRODUCT_HANDHELDLEGEND_PROGCC :
807
+ // ProGCC Mapping
808
+ SDL_strlcat (mapping_string , "a:b1,b:b0,back:b15,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b8,lefttrigger:b12,leftx:a0,lefty:a1,misc1:b17,rightshoulder:b11,rightstick:b9,righttrigger:b13,rightx:a2,righty:a3,start:b14,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1," , sizeof (mapping_string ));
809
+ break ;
810
+
811
+ case USB_PRODUCT_HANDHELDLEGEND_GCULTIMATE :
812
+ // GC Ultimate Map
813
+ SDL_strlcat (mapping_string , "a:b0,b:b2,back:b15,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b8,lefttrigger:a4,leftx:a0,lefty:a1,misc1:b17,misc3:b18,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a5,rightx:a2,righty:a3,start:b14,x:b1,y:b3,hint:!SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS:=1," , sizeof (mapping_string ));
814
+ break ;
815
+
816
+ case USB_PRODUCT_HANDHELDLEGEND_SINPUT_GENERIC :
817
+ if (u_id != 1 ) {
818
+ return NULL ;
819
+ }
820
+
821
+ // SuperGamepad+ Map
822
+ if (u_id == 1 ) {
823
+ SDL_strlcat (mapping_string , "a:b1,b:b0,back:b11,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,leftshoulder:b8,rightshoulder:b9,start:b10,x:b3,y:b2," , sizeof (mapping_string ));
824
+ }
825
+
826
+ // Apply face style
827
+ switch (face_style ) {
828
+ default :
829
+ case 1 :
830
+ SDL_strlcat (mapping_string , "face:abxy," , sizeof (mapping_string ));
831
+ break ;
832
+ case 2 :
833
+ SDL_strlcat (mapping_string , "face:axby," , sizeof (mapping_string ));
834
+ break ;
835
+ case 3 :
836
+ SDL_strlcat (mapping_string , "face:bayx," , sizeof (mapping_string ));
837
+ break ;
838
+ case 4 :
839
+ SDL_strlcat (mapping_string , "face:sony," , sizeof (mapping_string ));
840
+ break ;
841
+ }
842
+ break ;
843
+
844
+ default :
845
+ case USB_PRODUCT_BONJIRICHANNEL_FIREBIRD :
846
+ // Unmapped devices
847
+ return NULL ;
848
+ }
801
849
} else {
802
850
// All other gamepads have the standard set of 19 buttons and 6 axes
803
851
if (SDL_IsJoystickGameCube (vendor , product )) {
@@ -1235,6 +1283,7 @@ static bool SDL_PrivateParseGamepadElement(SDL_Gamepad *gamepad, const char *szG
1235
1283
if (SDL_strstr (gamepad -> mapping -> mapping , ",hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" ) != NULL ) {
1236
1284
baxy_mapping = true;
1237
1285
}
1286
+
1238
1287
// FIXME: We fix these up when loading the mapping, does this ever get hit?
1239
1288
//SDL_assert(!axby_mapping && !baxy_mapping);
1240
1289
0 commit comments