Browse Source

enabled os2 joystick code (if anyone has actually a use for it...)

Ozkan Sezer 3 years ago
parent
commit
7f728f3eb6
2 changed files with 41 additions and 4 deletions
  1. 38 0
      docs/README-os2.md
  2. 3 4
      include/SDL_config_os2.h

+ 38 - 0
docs/README-os2.md

@@ -52,3 +52,41 @@ Installing:
   version installed, close all SDL2 applications before replacing the old
   version installed, close all SDL2 applications before replacing the old
   copy.  Also make sure that any other older versions of DLLs are removed
   copy.  Also make sure that any other older versions of DLLs are removed
   from your system.
   from your system.
+
+
+Joysticks in SDL2:
+------------------
+
+The joystick code in SDL2 is a direct forward-port from the SDL-1.2 version.
+Here is the original documentation from SDL-1.2:
+
+The Joystick detection only works for standard joysticks (2 buttons, 2 axes
+and the like). Therefore, if you use a non-standard joystick, you should
+specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
+file or CONFIG.SYS, so SDL applications can provide full capability to your
+device. The syntax is:
+
+SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
+
+So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
+the line should be:
+
+SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
+
+If you want to add spaces in your joystick name, just surround it with
+quotes or double-quotes:
+
+SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
+
+or
+
+SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
+
+   Note however that Balls and Hats are not supported under OS/2, and the
+value will be ignored... but it is wise to define these correctly because
+in the future those can be supported.
+
+   Also the number of buttons is limited to 2 when using two joysticks,
+4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
+and 8 when using a joystick with 2 axes. Notice however these are limitations
+of the Joystick Port hardware, not OS/2.

+ 3 - 4
include/SDL_config_os2.h

@@ -33,14 +33,13 @@
 
 
 #define SDL_POWER_DISABLED  1
 #define SDL_POWER_DISABLED  1
 #define SDL_HAPTIC_DISABLED 1
 #define SDL_HAPTIC_DISABLED 1
-#define SDL_JOYSTICK_DISABLED 1
-/*#undef SDL_JOYSTICK_OS2 */
-/*#undef SDL_JOYSTICK_HIDAPI */
-/*#undef SDL_JOYSTICK_VIRTUAL */
 
 
 #define SDL_SENSOR_DUMMY 1
 #define SDL_SENSOR_DUMMY 1
 #define SDL_VIDEO_DRIVER_DUMMY 1
 #define SDL_VIDEO_DRIVER_DUMMY 1
 #define SDL_VIDEO_DRIVER_OS2 1
 #define SDL_VIDEO_DRIVER_OS2 1
+#define SDL_JOYSTICK_OS2 1
+/*#undef SDL_JOYSTICK_HIDAPI */
+/*#undef SDL_JOYSTICK_VIRTUAL */
 
 
 /* Enable OpenGL support */
 /* Enable OpenGL support */
 /* #undef SDL_VIDEO_OPENGL */
 /* #undef SDL_VIDEO_OPENGL */