Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d0641f9
riscos: Add support for additional mouse events
ccawley2011 Sep 20, 2020
eff6357
riscos: Fix off-by-one issues with mouse coordinates
ccawley2011 Sep 21, 2020
8560bb3
joystick/linux: Enhance detection of gamepads
pcercuei Sep 22, 2020
3c29190
joystick/linux: Allow for custom joystick names
pcercuei Sep 22, 2020
a18f656
video/fbcon: Fix double buffering with non-fullscreen
pcercuei Sep 22, 2020
f9bb9d6
video/fbcon: Clear framebuffer at init
pcercuei Sep 22, 2020
2807b36
video/fbcon: Allow exiting without clearing the
pcercuei Sep 22, 2020
a2fa48b
video/fbcon: Fix keyboard input when not launched from
pcercuei Sep 22, 2020
eceedec
video/fbcon: Implement triple-buffering
pcercuei Sep 22, 2020
35b60de
video/fbcon: Allow running as non-root
pcercuei Sep 22, 2020
5c019c6
video/fbcon: Remove useless wait-for-vblank ioctl
pcercuei Sep 22, 2020
72d6be0
joystick/linux: Fix invalid coef when axis min > axis max
pcercuei Sep 22, 2020
0feade3
fix -Wparentheses warning after commit 1c7030e282b0
sezero Sep 22, 2020
71809f0
updated Watcom-Win32.zip for newer dx headers.
sezero Sep 24, 2020
3cad43b
joystick/os2: add back the driver with joyos2.h inclusion removed,
sezero Oct 18, 2020
fd9dc6f
os2: replace a few "not enough memory" SetError()s with SDL_OutOfMemo…
sezero Oct 18, 2020
921ec04
Watcom-OS2.zip: replaced FSLib with a freshly re-built one:
sezero Oct 20, 2020
9bad327
os2/SDL_systimer.c: removed the watcom-only asm
sezero Oct 20, 2020
e6682fc
video, SDL_os2fslib.c: changed struct BMPINFO to be more compatible
sezero Oct 20, 2020
d1947c2
video, SDL_os2fslib.c: use calloc instead of malloc where it's suitable
sezero Oct 20, 2020
9ae06ae
SDL_os2fslib.c: whitespace / code style tidy-up
sezero Oct 21, 2020
2f4d177
SDL_os2fslib.c (os2fslib_PumpEvents): replace difftime with DosQueryS…
sezero Oct 21, 2020
c32de7e
updated Watcom-OS2.zip (adds an emx import lib for FSLib)
sezero Oct 21, 2020
39ff196
SDL_opengl.h: add another __gl_glext_h_ check. (cf.: bug #5216.)
sezero Oct 24, 2020
57b5fc7
SDL_opengl.h: fixed glGenVertexArraysAPPLE() signature.
sezero Oct 24, 2020
752ad74
os2/SDL_sysjoystick.c: move struct _transaxes oot of struct joystick_…
sezero Oct 25, 2020
f702849
updated docs for 1.2.16 changes so far.
sezero Oct 25, 2020
9665b3c
SDL-1.2: fix crash in CPU_haveARMSIMD()
1bsyl Nov 13, 2020
d0b4022
Fixed bug 5328 - fast paths for 24/32-bit blitting on SDL-1.2
1bsyl Nov 14, 2020
83cbfcb
updated docs for 1.2.16 changes so far.
sezero Nov 14, 2020
0ae2aab
coreaudio: change outputAudioUnit type to AudioComponentInstance.
sezero Nov 15, 2020
330e56d
tests: update acinclude.m4 from top-level sdl.m4
sezero Dec 20, 2020
4c23c54
sdl.m4: update to use pkgconfig if available.
sezero Dec 20, 2020
5347370
tests: regenerate configure using autoconf patched for AC_PATH_X11
sezero Dec 20, 2020
5f51531
multiple updates to autotools build system from default SDL2 branch
sezero Dec 30, 2020
06da030
SDL_x11events.c: properly handle input focus events (fix bug #5426)
sezero Dec 30, 2020
7230362
SDL_endian.h: backport arm64 implementations of SDL_Swap16/32 from SDL2
sezero Dec 30, 2020
a21ff2a
joystick/linux: remove deadzone and output axis values in correct range
sezero Jan 2, 2021
d68f847
Update config.guess and config.sub from mainstream.
sezero Jan 5, 2021
e3b6e37
os/2: imported new video driver (os2grop) authored by Andrey Vasilkin.
sezero Jan 22, 2021
7c56c1b
minor cleanup to os2 joystick code.
sezero Jan 22, 2021
7a4390c
renamed configure.in to configure.ac
sezero Jan 23, 2021
b5a0c9d
autotools build system updates / fixes.
sezero Jan 23, 2021
9d11db3
add SDL_VIDEO_DRIVER_OS2GROP to SDL_config.h.in
sezero Jan 23, 2021
4d40705
renamed SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H to SDL_HAVE_MACHINE_JO…
sezero Jan 23, 2021
698509b
config.guess and config.sub updates from mainstream
sezero Jan 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
SDLMAIN_LDFLAGS = @SDLMAIN_LDFLAGS@

DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE VisualC.html VisualC Watcom-OS2.zip Watcom-Win32.zip symbian.zip WhatsNew Xcode
DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.ac COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE VisualC.html VisualC os2 Makefile.os2 Watcom-Win32.zip symbian.zip WhatsNew Xcode

HDRS = SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h

Expand All @@ -53,7 +53,7 @@ LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-inf

all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)

$(srcdir)/configure: $(srcdir)/configure.in
$(srcdir)/configure: $(srcdir)/configure.ac
@echo "Warning, configure is out of date, please re-run autogen.sh"

Makefile: $(srcdir)/Makefile.in
Expand Down
144 changes: 144 additions & 0 deletions Makefile.os2
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# OpenWatcom makefile to build SDL for OS/2

!ifndef %WATCOM
!error Environment variable WATCOM is not specified!
!endif

DLLNAME = SDL12
VERSION = 1.2.16
LIBHOME = os2

INCPATH = -I$(%WATCOM)/h/os2 -I$(%WATCOM)/h
INCPATH+= -Iinclude -I"os2/h"
LIBPATH=$(LIBHOME)/lib
LIBNAME=$(DLLNAME)

DLLFILE = $(LIBHOME)/$(LIBNAME).dll
LIBFILE = $(LIBHOME)/$(LIBNAME).lib
LNKFILE=$(LIBNAME).lnk

CFLAGS_DEF=-bt=os2 -d0 -zq -bm -5s -fp5 -fpi87 -sg -oteanbmier $(INCPATH)
CFLAGS_DLL=$(CFLAGS_DEF) -bd
# Create debug build or not?
DEBUG=0
# Enable Hermes MMX blitters?
HERMES=1

# Special flags for building SDL
CFLAGS=$(CFLAGS_DLL) -otexan -wx -ei
CFLAGS+= -DBUILD_SDL
#CFLAGS+= -DCHECK_LEAKS
CFLAGS+= -DUSE_DOSSETPRIORITY

!ifeq HERMES 1
CFLAGS+= -DSDL_HERMES_BLITTERS=1
!endif
# USE_ASM_MIXER_VC has no effect since SDL-1.2.10.
#CFLAGS+= -DUSE_ASM_MIXER_VC

DESCRIPTION = Simple DirectMedia Layer 1.2

!ifeq DEBUG 1
CFLAGS += -d2 -DDEBUG_BUILD
DESCRIPTION += DEBUG
!endif

PMGRE_LIB = $(LIBPATH)/pmgre.lib
PMGRE_EXP = os2/pmgre/pmgre.exp

audioobjs = SDL_audiocvt.obj SDL_mixer.obj SDL_mixer_MMX_VC.obj SDL_wave.obj &
SDL_audio.obj SDL_dummyaudio.obj SDL_diskaudio.obj SDL_dart.obj

cdromobjs = SDL_cdrom.obj SDL_syscdrom.obj
cpuinfoobjs = SDL_cpuinfo.obj
eventsobjs = SDL_active.obj SDL_events.obj SDL_expose.obj SDL_keyboard.obj &
SDL_mouse.obj SDL_quit.obj SDL_resize.obj
fileobjs = SDL_rwops.obj
joystickobjs = SDL_joystick.obj SDL_sysjoystick.obj
loadsoobjs = SDL_sysloadso.obj
threadobjs = SDL_thread.obj SDL_sysmutex.obj SDL_syssem.obj SDL_systhread.obj &
SDL_syscond.obj
timerobjs = SDL_timer.obj SDL_systimer.obj
videoobjs = SDL_blit.obj SDL_blit_0.obj SDL_blit_1.obj SDL_blit_A.obj &
SDL_blit_N.obj SDL_bmp.obj SDL_cursor.obj SDL_gamma.obj &
SDL_pixels.obj SDL_RLEaccel.obj SDL_stretch.obj SDL_surface.obj &
SDL_video.obj SDL_yuv.obj SDL_yuv_mmx.obj SDL_yuv_sw.obj &
SDL_os2grop.obj SDL_os2dive.obj SDL_os2vman.obj SDL_grop.obj &
SDL_os2fslib.obj &
SDL_nullevents.obj SDL_nullmouse.obj SDL_nullvideo.obj

stdlibobjs = SDL_malloc.obj SDL_qsort.obj SDL_string.obj
# SDL_iconv.obj

!ifeq HERMES 1
hermesobjs= mmx_main.obj mmxp2_32.obj x86_main.obj x86p_16.obj x86p_32.obj
!endif

object_files= SDL.obj SDL_error.obj SDL_fatal.obj &
$(stdlibobjs) $(audioobjs) $(cpuinfoobjs) $(eventsobjs) &
$(fileobjs) $(joystickobjs) $(loadsoobjs) $(threadobjs) &
$(timerobjs) $(hermesobjs) $(videoobjs) $(cdromobjs)

.extensions:
.extensions: .lib .dll .obj .c .asm

.asm: src/hermes
.c: src;src/audio;src/cdrom;src/cdrom/os2;src/cpuinfo;src/events;src/file;src/joystick;src/joystick/os2;src/loadso/os2;src/stdlib;src/thread;src/thread/os2;src/timer;src/timer/os2;src/video
.c: src/audio/dummy;src/audio/disk;src/audio/dart;src/video/dummy;src/video/os2fslib;src/video/os2grop

.c.obj:
wcc386 $(CFLAGS) -fo=$^@ $<
.asm.obj:
nasm -f obj -D__OS2__ -Isrc/hermes/ -o $^@ $<

all: $(DLLFILE) $(LIBFILE) .symbolic

$(DLLFILE): compiling_info $(object_files) $(LNKFILE) $(PMGRE_LIB)
@echo * Linking: $@
@wlink @$(LNKFILE)

$(LIBFILE): $(DLLFILE)
@echo * Creating LIB file: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)

SDL_RLEaccel.obj:
wcc386 $(cflags) -w1 -fo=$^@ src/video/SDL_RLEaccel.c

compiling_info : .symbolic
@echo * Compiling...

$(PMGRE_LIB): $(PMGRE_EXP)
@echo * Creating PMGRE import library
wlib -q -b -n -c -pa -s -t -zld -ii -io $(PMGRE_LIB) @$(PMGRE_EXP)

$(LNKFILE):
@echo * Creating linker file: $@
@%create $@
@%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
@%append $@ NAME $(DLLFILE)
@for %i in ($(object_files)) do @%append $@ FILE %i
@%append $@ LIBPATH $(LIBPATH)
@%append $@ LIB FSLib.lib
@%append $@ LIB pmgre.lib
@%append $@ LIB mmpm2.lib
@%append $@ LIB libuls.lib
@%append $@ LIB libconv.lib
@%append $@ OPTION QUIET
@%append $@ OPTION IMPF=$^&.exp
@%append $@ OPTION MAP=$^&.map
@%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
@%append $@ OPTION ELIMINATE
@%append $@ OPTION MANYAUTODATA
@%append $@ OPTION OSNAME='OS/2 and eComStation'
@%append $@ OPTION SHOWDEAD

clean: .SYMBOLIC
@echo * Clean: $(LIBNAME) $(VERSION)
@if exist *.obj rm *.obj
@if exist *.map rm *.map
@if exist *.exp rm *.exp
@if exist $(LNKFILE) rm $(LNKFILE)

distclean: clean .SYMBOLIC
@if exist $(DLLFILE) rm $(DLLFILE)
@if exist $(LIBFILE) rm $(LIBFILE)
2 changes: 1 addition & 1 deletion README.MacOSX
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You should replace EXE_NAME with the name of the executable. APP_NAME is what
will be visible to the user in the Finder. Usually it will be the same
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
usually is "TestGame". You might also want to use @PACKAGE@ to use the package
name as specified in your configure.in file.
name as specified in your configure.ac file.

If your project builds more than one application, you will have to do a bit
more. For each of your target applications, you need a seperate rule.
Expand Down
153 changes: 67 additions & 86 deletions README.OS2
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,86 @@
SDL on OS/2
===========

Last updated on May. 17, 2006.


1. How to compile?
------------------

To compile this, you'll need the followings installed:
- The OS/2 Developer's Toolkit
- The OpenWatcom compiler
(http://www.openwatcom.org)

First of all, you have to unzip the Watcom-OS2.zip file. This will result in a
file called "makefile" and a file called "setvars.cmd" in this folder (and some
more files...).
Open Watcom 1.9 (http://www.openwatcom.org) or newer is tested.
For the new Open Watcom V2 fork, see: https://github.com/open-watcom/ and
https://open-watcom.github.io

Please edit the second, fourth and fifth lines of setvars.cmd file
to set the folders where the toolkit, the OW compiler and the FSLib are.
You won't need NASM yet (The Netwide Assembler), you can leave that line.
Run setvars.cmd, and you should get a shell in which you can
compile SDL.
WATCOM ervironment variable must to be set to the Open Watcom install
directory. To compile, run: wmake -f Makefile.os2

Check the "makefile" file. There is a line in there which determines if the
Check the "Makefile.os2" file. There is a line in there which determines if the
resulting SDL.DLL will be a 'debug' or a 'release' build. The 'debug' version
is full of printf()'s, so if something goes wrong, its output can help a lot
for debugging.

Then run "wmake".
This should create the SDL12.DLL and the corresponding SDL12.LIB file here.

To test applications, it's a good idea to use the 'debug' build of SDL, and
redirect the standard output and standard error output to files, to see what
happens internally in SDL.
(like: testsprite >stdout.txt 2>stderr.txt)
2. Video drivers
----------------

See SDL_config_os2.h for two OS/2 video drivers:

To rebuild SDL, use the following commands in this folder:
wmake clean
wmake
- SDL_VIDEO_DRIVER_OS2FS: The old OS/2 Video Output using FSLib.
Disabled by default. Requires FSLib.dll and preinstalled SciTech SNAP
graphics drivers.

- SDL_VIDEO_DRIVER_OS2GROP: New OS/2 video output driver using 'GrOp'
library. Enabled by default.

You can set the SDL_VIDEODRIVER environment variable to select/control
the video output drivers. E.g.:
SET SDL_VIDEODRIVER=DIVE

2. How to compile the testapps?
-------------------------------
Valid values for the GrOp driver:

Once you have SDL12.DLL compiled, navigate into the 'test' folder, copy in
there the newly built SDL12.DLL, and copy in there FSLib.DLL.
- DIVE: This is the default. Allows you to easily scale the window.
For full-screen mode uses the current video mode and maximized PM
window with scaled image.

Then run "wmake" in there to compile some of the testapps.
- VMAN: Low-level access to the video system.
For full-screen mode uses the current video mode and maximized PM
window with centered image.

- VMANFS: More productive. Uses real fullscreen mode.
Video mode switching in VMAN subsystem is unstable and may cause
system hang. Use it at your own risk!

Valid values for the FSLib driver:

3. What is missing?
-------------------
- FSLIB: Chooses the FSLib driver, if was enabled at compile time.

OpenGL is not supported by any of the drivers.

The following things are missing from this SDL implementation:
- MMX, SSE and 3DNOW! optimized video blitters?
- HW Video surfaces
- OpenGL support
You may significantly increase video output speed with OS4 kernel and patched
files vman.dll and dive.dll or with latest versions of ACPI support and video
driver Panorama.

You may significantly increase video output speed with OS4 kernel and patched
files vman.dll and dive.dll or with latest versions of ACPI support and video
driver Panorama.

Latest versions of OS/4 kernel:
http://gus.biysk.ru/os4/
(Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4)

4. Special Keys / Full-Screen support
Patched files vman.dll and dive.dll:
http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR


3. Special Keys / Full-Screen support
-------------------------------------

There are two special hot-keys implemented:
- Alt+Home switches between fullscreen and windowed mode
- Alt+End simulates closing the window (can be used as a Panic key)
Only the LEFT Alt key will work.

Only the LEFT Alt key will work.


5. Joysticks on SDL/2
---------------------
4. Joysticks in SDL
-------------------

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
Expand Down Expand Up @@ -108,8 +116,8 @@ of the Joystick Port hardware, not OS/2.



6. Proportional windows
-----------------------
5. Proportional windows (FSLib driver only)
-------------------------------------------

For some SDL applications it can be handy to have proportional windows, so
the windows will keep their aspect ratio when resized.
Expand All @@ -130,27 +138,18 @@ This can be achieved in two ways:
at the first run.



7. Audio in SDL applications
6. Audio in SDL applications
----------------------------

Audio effects are one of the most important features in games. Creating audio
effects in sync with the game and without hickups and pauses in the audio are
very important things.

However there are multithreaded SDL applications that have tight loops as their
main logic loop. This kills performance in OS/2, and takes too much CPU from
other threads in the same process, for example from the thread to create the
sound effects.
The OS/2 port of SDL can be instructed to run the audio thread in high
priority, which makes sure that there will be enough time for the processing
of the audio data.

For this reason, the OS/2 port of SDL can be instructed to run the audio thread
in high priority, which makes sure that there will be enough time for the
processing of the audio data.

At default, SDL/2 runs the audio thread at ForegroundServer+0 priority. Well
By default, SDL runs the audio thread at ForegroundServer+0 priority. Well
written and well behaving SDL applications should work well in this mode.
For other applications, you can tell SDL/2 to run the audio thread at
TimeCritical priority by setting an env.variable before starting the SDL app:
For other applications, you can tell SDL to run the audio thread at
TimeCritical priority by setting an environment variable before starting the
SDL app:

SET SDL_USE_TIMECRITICAL_AUDIO=1

Expand All @@ -159,36 +158,20 @@ tight infinite loop in this thread, this will make the whole system
unresponsive, so use it with care, and only for applications that need it!



8. Next steps...
----------------

Things to do:
- Implement missing stuffs (look for 'TODO' string in source code!)
- Finish video driver (the 'wincommon' can be a good example for missing
things like application icon and so on...)
- Enable MMX/SSE/SSE2 acceleration functions
- Rewrite CDROM support using DOS Ioctl for better support.



9. Contacts
7. Authors
-----------

You can contact the developers for bugs:

Area Developer email
General (Audio/Video/System) Doodle doodle@scenergy.dfmk.hu
CDROM and Joystick Caetano daniel@caetano.eng.br

Notice however that SDL/2 is 'in development' stage so ... if you want to help,
please, be our guest and contact us!
- Andrey Vasilkin <digi@os2.snc.ru> Video (GrOp library)
- Doodle <doodle@scenergy.dfmk.hu> General (Audio/Video/System)
- Caetano <daniel@caetano.eng.br> CDROM and Joystick



10. Changelog of the OS/2 port
8. Changelog of the OS/2 port
------------------------------

Version 1.2.16 - 2021-01-22
- Imported new video driver (os2grop) by Andrey Vasilkin

Version 1.2.10 - 2006-05-17 - Doodle
- Small modifications for v1.2.10 release
- Changed DLL name to include version info (currently SDL12.dll)
Expand Down Expand Up @@ -277,5 +260,3 @@ Version 1.2.7 - 2004-07-02a - Caetano
- Added CDROM support to tree (SDL-1.2.7\src\cdrom\os2\SDL_syscdrom.c)
- Modified makefile (SDL-1.2.7\src\makefiles.wat and SDL-1.2.7\watcom.mif) to build with CDROM support
- Added the "extra" SDL_types.h forgotten in 2004-07-02 version.

<End-Of-File>
Loading