README.OS2
author Sam Lantinga <slouken@libsdl.org>
Sat, 05 Sep 2009 09:12:03 +0000
changeset 3244 7c73d5b5a0d6
parent 1895 c121d94672cb
permissions -rw-r--r--
Removed references to CD-ROM support from the README files
     1 
     2 ===========
     3 SDL on OS/2
     4 ===========
     5 
     6 Last updated on May. 1, 2006.
     7 
     8 
     9 1. How to compile?
    10 ------------------
    11 
    12 To compile this, you'll need the followings installed:
    13 - The OS/2 Developer's Toolkit
    14 - The OpenWatcom compiler 
    15   (http://www.openwatcom.org)
    16 - The FSLib library
    17   (ftp://ftp.netlabs.org/pub/SDL)
    18 
    19 First of all, you have to unzip the Watcom-OS2.zip file. This will result in a 
    20 file called "makefile" and a file called "setvars.cmd" in this folder (and some
    21 more files...).
    22 
    23 Please edit the second, fourth and fifth lines of setvars.cmd file
    24 to set the folders where the toolkit, the OW compiler and the FSLib are. 
    25 You won't need NASM yet (The Netwide Assembler), you can leave that line.
    26 Run setvars.cmd, and you should get a shell in which you can
    27 compile SDL.
    28 
    29 Check the "makefile" file. There is a line in there which determines if the 
    30 resulting SDL.DLL will be a 'debug' or a 'release' build. The 'debug' version 
    31 is full of printf()'s, so if something goes wrong, its output can help a lot
    32 for debugging.
    33 
    34 Then run "wmake".
    35 This should create the SDL.DLL and the corresponding SDL.LIB file here.
    36 
    37 To test applications, it's a good idea to use the 'debug' build of SDL, and
    38 redirect the standard output and standard error output to files, to see what
    39 happens internally in SDL.
    40 (like: testsprite >stdout.txt 2>stderr.txt)
    41 
    42 To rebuild SDL, use the following commands in this folder:
    43 wmake clean
    44 wmake
    45 
    46 
    47 
    48 2. How to compile the testapps?
    49 -------------------------------
    50 
    51 Once you have SDL.DLL compiled, navigate into the 'test' folder, copy in there
    52 the newly built SDL.DLL, and copy in there FSLib.DLL.
    53 
    54 Then run "wmake" in there to compile some of the testapps.
    55 
    56 
    57 
    58 3. What is missing?
    59 -------------------
    60 
    61 The following things are missing from this SDL implementation:
    62 - MMX, SSE and 3DNOW! optimized video blitters?
    63 - HW Video surfaces
    64 - OpenGL support
    65 
    66 
    67 
    68 4. Special Keys / Full-Screen support
    69 -------------------------------------
    70 
    71 There are two special hot-keys implemented:
    72 - Alt+Home switches between fullscreen and windowed mode
    73 - Alt+End simulates closing the window (can be used as a Panic key)
    74 Only the LEFT Alt key will work.
    75 
    76 
    77 
    78 5. Joysticks on SDL/2
    79 ---------------------
    80 
    81 The Joystick detection only works for standard joysticks (2 buttons, 2 axes
    82 and the like). Therefore, if you use a non-standard joystick, you should
    83 specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
    84 file or CONFIG.SYS, so SDL applications can provide full capability to your
    85 device. The syntax is:
    86 
    87 SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
    88 
    89 So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
    90 the line should be:
    91 
    92 SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
    93 
    94 If you want to add spaces in your joystick name, just surround it with
    95 quotes or double-quotes:
    96 
    97 SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
    98 
    99 or
   100 
   101 SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
   102 
   103    Notive However that Balls and Hats are not supported under OS/2, and the
   104 value will be ignored... but it is wise to define these correctly because 
   105 in the future those can be supported.
   106    Also the number of buttons is limited to 2 when using two joysticks,
   107 4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
   108 and 8 when using a joystick with 2 axes. Notice however these are limitations 
   109 of the Joystick Port hardware, not OS/2.
   110 
   111 
   112 
   113 6. Proportional windows
   114 -----------------------
   115 
   116 For some SDL applications it can be handy to have proportional windows, so
   117 the windows will keep their aspect ratio when resized.
   118 This can be achieved in two ways:
   119 
   120 - Before starting the given SDL application, set the
   121   SDL_USE_PROPORTIONAL_WINDOW environment variable to something, e.g.:
   122 
   123   SET SDL_USE_PROPORTIONAL_WINDOW=1
   124   dosbox.exe
   125 
   126 - If you have a HOME environment variable set, then SDL will look for a file
   127   in there called ".sdl.proportionals". If that file contains the name of the
   128   currently running SDL executable, then that process will have proportional
   129   windows automatically.
   130 
   131   Please note that this file is created automatically with default values
   132   at the first run.
   133 
   134 
   135 
   136 7. Audio in SDL applications
   137 ----------------------------
   138 
   139 Audio effects are one of the most important features in games. Creating audio
   140 effects in sync with the game and without hickups and pauses in the audio are
   141 very important things.
   142 
   143 However there are multithreaded SDL applications that have tight loops as their
   144 main logic loop. This kills performance in OS/2, and takes too much CPU from
   145 other threads in the same process, for example from the thread to create the 
   146 sound effects.
   147 
   148 For this reason, the OS/2 port of SDL can be instructed to run the audio thread
   149 in high priority, which makes sure that there will be enough time for the 
   150 processing of the audio data.
   151 
   152 At default, SDL/2 runs the audio thread at ForegroundServer+0 priority. Well 
   153 written and well behaving SDL applications should work well in this mode.
   154 For other applications, you can tell SDL/2 to run the audio thread at 
   155 TimeCritical priority by setting an env.variable before starting the SDL app:
   156 
   157     SET SDL_USE_TIMECRITICAL_AUDIO=1
   158 
   159 Please note that this is a bit risky, because if the SDL application runs a
   160 tight infinite loop in this thread, this will make the whole system 
   161 unresponsive, so use it with care, and only for applications that need it!
   162 
   163 
   164 
   165 8. Next steps...
   166 ----------------
   167 
   168 Things to do:
   169 - Implement missing stuffs (look for 'TODO' string in source code!)
   170 - Finish video driver (the 'wincommon' can be a good example for missing
   171   things like application icon and so on...)
   172 - Enable MMX/SSE/SSE2 acceleration functions
   173 
   174 
   175 
   176 9. Contacts
   177 -----------
   178 
   179    You can contact the developers for bugs:
   180 
   181    Area					Developer		email
   182    General (Audio/Video/System)		Doodle			doodle@scenergy.dfmk.hu
   183    CDROM and Joystick			Caetano			daniel@caetano.eng.br
   184 
   185    Notice however that SDL/2 is 'in development' stage so ... if you want to help,
   186 please, be our guest and contact us!
   187 
   188 
   189 
   190 10. Changelog of the OS/2 port
   191 ------------------------------
   192 
   193 Version 1.2 - 2006-05-01  - Doodle
   194  - Modified makefile system to have only one makefile
   195  - Included FSLib headers, DLL and LIB file
   196 
   197 Version 1.2 - 2006-02-26  - Doodle
   198  - Updated the official SDL version with the OS/2 specific changes.
   199  - Added support for real unicode keycode conversion.
   200 
   201 Version 1.2.7 - 2006-01-20  - Doodle
   202  - Added support for selectively using timecritical priority for
   203    audio threads by SDL_USE_TIMECRITICAL_AUDIO environment variable.
   204    (e.g.: 
   205     SET SDL_USE_TIMECRITICAL_AUDIO=1
   206     dosbox.exe
   207    )
   208 
   209 Version 1.2.7 - 2005-12-22  - Doodle
   210  - Added support for proportional SDL windows.
   211    There are two ways to have proportional (aspect-keeping) windows for
   212    a given SDL application: Either set the SDL_USE_PROPORTIONAL_WINDOW
   213    environment variable to something before starting the application
   214    (e.g.: 
   215     SET SDL_USE_PROPORTIONAL_WINDOW=1
   216     dosbox.exe
   217    )
   218    or, if you have the HOME environment variable set, then SDL.DLL will
   219    create a file in that directory called .sdl.proportionals, and you can
   220    put there the name of executable files that will be automatically made
   221    proportional.
   222 
   223 Version 1.2.7 - 2005-10-14  - Doodle
   224  - Enabled Exception handler code in FSLib to be able to restore original
   225    desktop video mode in case the application crashes.
   226  - Added the missing FSLib_Uninitialize() call into SDL.
   227    (The lack of it did not cause problems, but it's cleaner this way.)
   228  - Fixed a mouse problem in Fullscreen mode where any mouse click
   229    re-centered the mouse.
   230 
   231 Version 1.2.7 - 2005-10-09  - Doodle
   232  - Implemented window icon support
   233 
   234 Version 1.2.7 - 2005-10-03  - Doodle
   235  - Reworked semaphore support again
   236  - Tuned thread priorities
   237 
   238 Version 1.2.7 - 2005-10-02  - Doodle
   239  - Added support for custom mouse pointers
   240  - Fixed WM_CLOSE processing: give a chance to SDL app to ask user...
   241  - Added support for MMX-accelerated audio mixers
   242  - Other small fixes
   243 
   244 Version 1.2.7 - 2005-09-12  - Doodle
   245  - Small fixes for DosBox incorporated into public release
   246  - Fixed semaphore support (SDL_syssem.c)
   247  - Fixed FSLib to have good clipping in scaled window mode,
   248    and to prevent occasional desktop freezes.
   249 
   250 Version 1.2.7 - 2004-09-08a - Caetano
   251 	- Improved joystick support (general verifications about hardware).
   252 	- Added support up to 8 buttons in 2 axes joysticks and 6 buttons in 3 axes joysticks.
   253 	- Added support to environment variable SDL_OS2_JOYSTICK to specify a joystick.
   254 	- Improved Joystick test to handle every type of joystick and display only relevant information.
   255 	- Merged with Doodle 2004-09-08
   256 	- Little tid up in README.OS2
   257 	- Added explanation about SDL_OS2_JOYSTICK environment variable on README.OS2
   258 
   259 Version 1.2.7 - 2004-09-07 - Caetano
   260 	- Merged with changes in headers for GCC compiling.
   261 	- Added Joystick support using basic IBM GAME$ support, allowing it to work with all joystick drivers since OS/2 2.1.
   262 	- Improved joystick detection (hacked!). OS/2 do not allow real joystick detection, so... 
   263 	- Modified makefile in test to compile "testjoystick". Anyway, it's useless, since it seems to cause a lot of trouble in OS/2 (because os video routines, not Joystick support).
   264 	- Created separated Joystick test program to test only joystick functions.
   265 	- Improved joystick auto-centering.
   266 	- Improved the coordinate correction routine to use two scale factors for each axis.
   267 
   268 Version 1.2.7 - 2004-07-05 - Caetano
   269 	- Corrected the time returned by status in CDROM support (it was incorrect)
   270 	- Added the testcdrom.c and corrected the linking directive (it was causing an error)
   271 
   272 Version 1.2.7 - 2004-07-02a - Caetano
   273 	- Corrected a little problem in a comment at SDL-1.2.7\test\torturethread.c, line 18 (missing */, nested comment)
   274 	- Added CDROM support to tree (SDL-1.2.7\src\cdrom\os2\SDL_syscdrom.c)
   275 	- Modified makefile (SDL-1.2.7\src\makefiles.wat and SDL-1.2.7\watcom.mif) to build with CDROM support
   276 	- Added the "extra" SDL_types.h forgotten in 2004-07-02 version.
   277 
   278 <End-Of-File>