Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
First Version of Sensors Support
Browse files Browse the repository at this point in the history
  • Loading branch information
BeWorld2018 authored and BSzili committed May 3, 2020
1 parent 49f262d commit d57be3e
Show file tree
Hide file tree
Showing 4 changed files with 276 additions and 424 deletions.
3 changes: 3 additions & 0 deletions src/joystick/SDL_gamecontrollerdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ static const char *s_ControllerMappings [] =
#if defined(__AMIGAOS4__)
"53504545442d4c494e4b20436f6d7065,SPEED-LINK Competition Pro,platform:AmigaOS 4,a:b0,b:b1,x:b3,y:b2,leftx:a0,lefty:a1,",
#endif
#if defined(__MORPHOS__)
"030000004c050000c405000000000000,PlayStation 4 Dualshock Controller,platform:MorphOS,a:b6,b:b7,x:b4,y:b5,back:b3,start:b2,leftstick:b8,rightstick:b9,leftshoulder:b0,rightshoulder:b1,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:+a4,righttrigger:+a5,",
#endif
"hidapi,*,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
NULL
};
Expand Down
8 changes: 8 additions & 0 deletions src/joystick/SDL_joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -1453,10 +1453,18 @@ void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *prod
/* guid16[6] is product version */
) {
if (vendor) {
#ifdef __MORPHOS__
*vendor = SDL_SwapLE16(guid16[2]);
#else
*vendor = guid16[2];
#endif
}
if (product) {
#ifdef __MORPHOS__
*product = SDL_SwapLE16(guid16[4]);
#else
*product = guid16[4];
#endif
}
if (version) {
*version = guid16[6];
Expand Down
Loading

0 comments on commit d57be3e

Please sign in to comment.