Updated OS/2 build, yay!
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401446
This commit is contained in:
parent
e1f2aca17a
commit
46f459a736
32 changed files with 727 additions and 675 deletions
|
@ -36,7 +36,7 @@ SDLMAIN_TARGET = libSDLmain.a
|
||||||
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
|
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
|
||||||
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
|
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
|
||||||
|
|
||||||
DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.in MPWmake.sea.bin PBProjects.tar.gz README* sdl-config.in sdl.m4 SDL.qpg.in SDL.spec SDL.spec.in setvars.cmd src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom.mif WhatsNew Xcode21.tar.gz Xcode.tar.gz XcodeUniversal.tar.gz
|
DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.in MPWmake.sea.bin PBProjects.tar.gz README* sdl-config.in sdl.m4 SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip WhatsNew Xcode21.tar.gz Xcode.tar.gz XcodeUniversal.tar.gz
|
||||||
|
|
||||||
LT_AGE = @LT_AGE@
|
LT_AGE = @LT_AGE@
|
||||||
LT_CURRENT = @LT_CURRENT@
|
LT_CURRENT = @LT_CURRENT@
|
||||||
|
|
150
README.OS2
150
README.OS2
|
@ -3,7 +3,7 @@
|
||||||
SDL on OS/2
|
SDL on OS/2
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Last updated on Oct 02, 2005.
|
Last updated on Feb. 26, 2006.
|
||||||
|
|
||||||
|
|
||||||
1. How to compile?
|
1. How to compile?
|
||||||
|
@ -16,6 +16,11 @@ To compile this, you'll need the followings installed:
|
||||||
- The FSLib library
|
- The FSLib library
|
||||||
(ftp://ftp.netlabs.org/pub/SDL)
|
(ftp://ftp.netlabs.org/pub/SDL)
|
||||||
|
|
||||||
|
First of all, you have to put the OS/2-specific Watcom makefiles into the
|
||||||
|
source code tree by unzipping the file Watcom-OS2.zip here. This will
|
||||||
|
result in a Watcom.mif and a setvars.cmd file in this folder, and several
|
||||||
|
Makefile.wat files in the src\ folder and in some of its subfolders.
|
||||||
|
|
||||||
Please edit the second, fourth and fifth lines of setvars.cmd file
|
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.
|
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.
|
You won't need NASM yet (The Netwide Assembler), you can leave that line.
|
||||||
|
@ -107,7 +112,59 @@ of the Joystick Port hardware, not OS/2.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
6. Next steps...
|
6. Proportional windows
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
For some SDL applications it can be handy to have proportional windows, so
|
||||||
|
the windows will keep their aspect ratio when resized.
|
||||||
|
This can be achieved in two ways:
|
||||||
|
|
||||||
|
- Before starting the given SDL application, set the
|
||||||
|
SDL_USE_PROPORTIONAL_WINDOW environment variable to something, e.g.:
|
||||||
|
|
||||||
|
SET SDL_USE_PROPORTIONAL_WINDOW=1
|
||||||
|
dosbox.exe
|
||||||
|
|
||||||
|
- If you have a HOME environment variable set, then SDL will look for a file
|
||||||
|
in there called ".sdl.proportionals". If that file contains the name of the
|
||||||
|
currently running SDL executable, then that process will have proportional
|
||||||
|
windows automatically.
|
||||||
|
|
||||||
|
Please note that this file is created automatically with default values
|
||||||
|
at the first run.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
7. 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.
|
||||||
|
|
||||||
|
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
|
||||||
|
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:
|
||||||
|
|
||||||
|
SET SDL_USE_TIMECRITICAL_AUDIO=1
|
||||||
|
|
||||||
|
Please note that this is a bit risky, because if the SDL application runs a
|
||||||
|
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:
|
Things to do:
|
||||||
|
@ -119,7 +176,7 @@ Things to do:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
7. Contacts
|
9. Contacts
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
You can contact the developers for bugs:
|
You can contact the developers for bugs:
|
||||||
|
@ -131,3 +188,90 @@ Things to do:
|
||||||
Notice however that SDL/2 is 'in development' stage so ... if you want to help,
|
Notice however that SDL/2 is 'in development' stage so ... if you want to help,
|
||||||
please, be our guest and contact us!
|
please, be our guest and contact us!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
10. Changelog of the OS/2 port
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
Version 1.2 - 2006-02-26 - Doodle
|
||||||
|
- Updated the official SDL version with the OS/2 specific changes.
|
||||||
|
- Added support for real unicode keycode conversion.
|
||||||
|
|
||||||
|
Version 1.2.7 - 2006-01-20 - Doodle
|
||||||
|
- Added support for selectively using timecritical priority for
|
||||||
|
audio threads by SDL_USE_TIMECRITICAL_AUDIO environment variable.
|
||||||
|
(e.g.:
|
||||||
|
SET SDL_USE_TIMECRITICAL_AUDIO=1
|
||||||
|
dosbox.exe
|
||||||
|
)
|
||||||
|
|
||||||
|
Version 1.2.7 - 2005-12-22 - Doodle
|
||||||
|
- Added support for proportional SDL windows.
|
||||||
|
There are two ways to have proportional (aspect-keeping) windows for
|
||||||
|
a given SDL application: Either set the SDL_USE_PROPORTIONAL_WINDOW
|
||||||
|
environment variable to something before starting the application
|
||||||
|
(e.g.:
|
||||||
|
SET SDL_USE_PROPORTIONAL_WINDOW=1
|
||||||
|
dosbox.exe
|
||||||
|
)
|
||||||
|
or, if you have the HOME environment variable set, then SDL.DLL will
|
||||||
|
create a file in that directory called .sdl.proportionals, and you can
|
||||||
|
put there the name of executable files that will be automatically made
|
||||||
|
proportional.
|
||||||
|
|
||||||
|
Version 1.2.7 - 2005-10-14 - Doodle
|
||||||
|
- Enabled Exception handler code in FSLib to be able to restore original
|
||||||
|
desktop video mode in case the application crashes.
|
||||||
|
- Added the missing FSLib_Uninitialize() call into SDL.
|
||||||
|
(The lack of it did not cause problems, but it's cleaner this way.)
|
||||||
|
- Fixed a mouse problem in Fullscreen mode where any mouse click
|
||||||
|
re-centered the mouse.
|
||||||
|
|
||||||
|
Version 1.2.7 - 2005-10-09 - Doodle
|
||||||
|
- Implemented window icon support
|
||||||
|
|
||||||
|
Version 1.2.7 - 2005-10-03 - Doodle
|
||||||
|
- Reworked semaphore support again
|
||||||
|
- Tuned thread priorities
|
||||||
|
|
||||||
|
Version 1.2.7 - 2005-10-02 - Doodle
|
||||||
|
- Added support for custom mouse pointers
|
||||||
|
- Fixed WM_CLOSE processing: give a chance to SDL app to ask user...
|
||||||
|
- Added support for MMX-accelerated audio mixers
|
||||||
|
- Other small fixes
|
||||||
|
|
||||||
|
Version 1.2.7 - 2005-09-12 - Doodle
|
||||||
|
- Small fixes for DosBox incorporated into public release
|
||||||
|
- Fixed semaphore support (SDL_syssem.c)
|
||||||
|
- Fixed FSLib to have good clipping in scaled window mode,
|
||||||
|
and to prevent occasional desktop freezes.
|
||||||
|
|
||||||
|
Version 1.2.7 - 2004-09-08a - Caetano
|
||||||
|
- Improved joystick support (general verifications about hardware).
|
||||||
|
- Added support up to 8 buttons in 2 axes joysticks and 6 buttons in 3 axes joysticks.
|
||||||
|
- Added support to environment variable SDL_OS2_JOYSTICK to specify a joystick.
|
||||||
|
- Improved Joystick test to handle every type of joystick and display only relevant information.
|
||||||
|
- Merged with Doodle 2004-09-08
|
||||||
|
- Little tid up in README.OS2
|
||||||
|
- Added explanation about SDL_OS2_JOYSTICK environment variable on README.OS2
|
||||||
|
|
||||||
|
Version 1.2.7 - 2004-09-07 - Caetano
|
||||||
|
- Merged with changes in headers for GCC compiling.
|
||||||
|
- Added Joystick support using basic IBM GAME$ support, allowing it to work with all joystick drivers since OS/2 2.1.
|
||||||
|
- Improved joystick detection (hacked!). OS/2 do not allow real joystick detection, so...
|
||||||
|
- 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).
|
||||||
|
- Created separated Joystick test program to test only joystick functions.
|
||||||
|
- Improved joystick auto-centering.
|
||||||
|
- Improved the coordinate correction routine to use two scale factors for each axis.
|
||||||
|
|
||||||
|
Version 1.2.7 - 2004-07-05 - Caetano
|
||||||
|
- Corrected the time returned by status in CDROM support (it was incorrect)
|
||||||
|
- Added the testcdrom.c and corrected the linking directive (it was causing an error)
|
||||||
|
|
||||||
|
Version 1.2.7 - 2004-07-02a - Caetano
|
||||||
|
- Corrected a little problem in a comment at SDL-1.2.7\test\torturethread.c, line 18 (missing */, nested comment)
|
||||||
|
- 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>
|
||||||
|
|
BIN
Watcom-OS2.zip
Normal file
BIN
Watcom-OS2.zip
Normal file
Binary file not shown.
33
Watcom.mif
33
Watcom.mif
|
@ -1,33 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This file contains the common includes for the
|
|
||||||
# Watcom makefiles to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
# Create debug build or not?
|
|
||||||
#debug_build=defined
|
|
||||||
|
|
||||||
# Special flags for building SDL
|
|
||||||
SDLCFlags = -dBUILD_SDL -dCHECK_LEAKS
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
|
|
||||||
!ifdef debug_build
|
|
||||||
debugflags = -d2 -dDEBUG_BUILD
|
|
||||||
!else
|
|
||||||
debugflags =
|
|
||||||
!endif
|
|
||||||
|
|
||||||
cflags = -zq $(debugflags) -bd -bm -bt=OS2 -5s -fpi -sg -otexan -wx -ei $(SDLCFlags) $(ExtraCFlags)
|
|
||||||
|
|
||||||
.extensions:
|
|
||||||
.extensions: .lib .dll .obj .c .asm
|
|
||||||
|
|
||||||
.c.obj : .AUTODEPEND
|
|
||||||
wcc386 $[* $(cflags)
|
|
||||||
|
|
||||||
.asm.obj : .AUTODEPEND
|
|
||||||
nasm -t -O2 -f obj -I$(%include) $[*.asm
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include "SDL_config_macosx.h"
|
#include "SDL_config_macosx.h"
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__)
|
||||||
#include "SDL_config_win32.h"
|
#include "SDL_config_win32.h"
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
#include "SDL_config_os2.h"
|
||||||
#else
|
#else
|
||||||
/* This is the minimal configuration that can be used to build SDL */
|
/* This is the minimal configuration that can be used to build SDL */
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include "SDL_config_macosx.h"
|
#include "SDL_config_macosx.h"
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__)
|
||||||
#include "SDL_config_win32.h"
|
#include "SDL_config_win32.h"
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
#include "SDL_config_os2.h"
|
||||||
#else
|
#else
|
||||||
/* This is the minimal configuration that can be used to build SDL */
|
/* This is the minimal configuration that can be used to build SDL */
|
||||||
|
|
||||||
|
|
136
include/SDL_config_os2.h
Normal file
136
include/SDL_config_os2.h
Normal file
|
@ -0,0 +1,136 @@
|
||||||
|
/*
|
||||||
|
SDL - Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2006 Sam Lantinga
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Sam Lantinga
|
||||||
|
slouken@libsdl.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SDL_config_os2_h
|
||||||
|
#define _SDL_config_os2_h
|
||||||
|
|
||||||
|
/* This is a set of defines to configure the SDL features */
|
||||||
|
|
||||||
|
typedef signed char int8_t;
|
||||||
|
typedef unsigned char uint8_t;
|
||||||
|
typedef signed short int16_t;
|
||||||
|
typedef unsigned short uint16_t;
|
||||||
|
typedef signed int int32_t;
|
||||||
|
typedef unsigned int uint32_t;
|
||||||
|
typedef unsigned int size_t;
|
||||||
|
typedef unsigned long uintptr_t;
|
||||||
|
typedef signed long long int64_t;
|
||||||
|
typedef unsigned long long uint64_t;
|
||||||
|
|
||||||
|
#define SDL_HAS_64BIT_TYPE 1
|
||||||
|
|
||||||
|
/* Use Watcom's LIBC */
|
||||||
|
#define HAVE_LIBC 1
|
||||||
|
|
||||||
|
/* Useful headers */
|
||||||
|
#define HAVE_SYS_TYPES_H 1
|
||||||
|
#define HAVE_STDIO_H 1
|
||||||
|
#define STDC_HEADERS 1
|
||||||
|
#define HAVE_STDLIB_H 1
|
||||||
|
#define HAVE_STDARG_H 1
|
||||||
|
#define HAVE_MALLOC_H 1
|
||||||
|
#define HAVE_MEMORY_H 1
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
#define HAVE_STRINGS_H 1
|
||||||
|
#define HAVE_INTTYPES_H 1
|
||||||
|
#define HAVE_STDINT_H 1
|
||||||
|
#define HAVE_CTYPE_H 1
|
||||||
|
#define HAVE_MATH_H 1
|
||||||
|
#define HAVE_SIGNAL_H 1
|
||||||
|
|
||||||
|
/* C library functions */
|
||||||
|
#define HAVE_MALLOC 1
|
||||||
|
#define HAVE_CALLOC 1
|
||||||
|
#define HAVE_REALLOC 1
|
||||||
|
#define HAVE_FREE 1
|
||||||
|
#define HAVE_ALLOCA 1
|
||||||
|
#define HAVE_GETENV 1
|
||||||
|
#define HAVE_PUTENV 1
|
||||||
|
#define HAVE_UNSETENV 1
|
||||||
|
#define HAVE_QSORT 1
|
||||||
|
#define HAVE_ABS 1
|
||||||
|
#define HAVE_BCOPY 1
|
||||||
|
#define HAVE_MEMSET 1
|
||||||
|
#define HAVE_MEMCPY 1
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
#define HAVE_MEMCMP 1
|
||||||
|
#define HAVE_STRLEN 1
|
||||||
|
#define HAVE_STRLCPY 1
|
||||||
|
#define HAVE_STRLCAT 1
|
||||||
|
#define HAVE_STRDUP 1
|
||||||
|
#define HAVE__STRREV 1
|
||||||
|
#define HAVE__STRUPR 1
|
||||||
|
#define HAVE__STRLWR 1
|
||||||
|
#define HAVE_INDEX 1
|
||||||
|
#define HAVE_RINDEX 1
|
||||||
|
#define HAVE_STRCHR 1
|
||||||
|
#define HAVE_STRRCHR 1
|
||||||
|
#define HAVE_STRSTR 1
|
||||||
|
#define HAVE_ITOA 1
|
||||||
|
#define HAVE__LTOA 1
|
||||||
|
#define HAVE__UITOA 1
|
||||||
|
#define HAVE__ULTOA 1
|
||||||
|
#define HAVE_STRTOL 1
|
||||||
|
#define HAVE__I64TOA 1
|
||||||
|
#define HAVE__UI64TOA 1
|
||||||
|
#define HAVE_STRTOLL 1
|
||||||
|
#define HAVE_STRTOD 1
|
||||||
|
#define HAVE_ATOI 1
|
||||||
|
#define HAVE_ATOF 1
|
||||||
|
#define HAVE_STRCMP 1
|
||||||
|
#define HAVE_STRNCMP 1
|
||||||
|
#define HAVE_STRICMP 1
|
||||||
|
#define HAVE_STRCASECMP 1
|
||||||
|
#define HAVE_SSCANF 1
|
||||||
|
#define HAVE_SNPRINTF 1
|
||||||
|
#define HAVE_VSNPRINTF 1
|
||||||
|
#define HAVE_SETJMP 1
|
||||||
|
#define HAVE_CLOCK_GETTIME 1
|
||||||
|
|
||||||
|
/* Enable various audio drivers */
|
||||||
|
#define SDL_AUDIO_DRIVER_DART 1
|
||||||
|
|
||||||
|
/* Enable various cdrom drivers */
|
||||||
|
#define SDL_CDROM_OS2 1
|
||||||
|
|
||||||
|
/* Enable various input drivers */
|
||||||
|
#define SDL_JOYSTICK_OS2 1
|
||||||
|
|
||||||
|
/* Enable various shared object loading systems */
|
||||||
|
#define SDL_LOADSO_OS2 1
|
||||||
|
|
||||||
|
/* Enable various threading systems */
|
||||||
|
#define SDL_THREAD_OS2 1
|
||||||
|
|
||||||
|
/* Enable various timer systems */
|
||||||
|
#define SDL_TIMER_OS2 1
|
||||||
|
|
||||||
|
/* Enable various video drivers */
|
||||||
|
#define SDL_VIDEO_DRIVER_OS2FS 1
|
||||||
|
|
||||||
|
/* Enable OpenGL support */
|
||||||
|
/* Nothing here yet for OS/2... :( */
|
||||||
|
|
||||||
|
/* Enable assembly routines where available */
|
||||||
|
#define SDL_ASSEMBLY_ROUTINES 1
|
||||||
|
|
||||||
|
#endif /* _SDL_config_os2_h */
|
|
@ -65,8 +65,8 @@ typedef struct SDL_Thread SDL_Thread;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __OS2__
|
#ifdef __OS2__
|
||||||
typedef int (__cdecl *pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
|
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
|
||||||
typedef void (__cdecl *pfnSDL_CurrentEndThread)(void);
|
typedef void (*pfnSDL_CurrentEndThread)(void);
|
||||||
#else
|
#else
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
16
setvars.cmd
16
setvars.cmd
|
@ -1,16 +0,0 @@
|
||||||
@ECHO OFF
|
|
||||||
SET WATCOM=d:\watcom
|
|
||||||
SET NASM=d:\nasm
|
|
||||||
SET OS2TK=d:\os2tk45
|
|
||||||
SET FSLIB=d:\watcom\projects\FSLib
|
|
||||||
|
|
||||||
SET PATH=%WATCOM%\BINP;%WATCOM%\BINW;%os2tk%\bin;%NASM%;%PATH%
|
|
||||||
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2
|
|
||||||
SET FINCLUDE=%WATCOM%\SRC\FORTRAN
|
|
||||||
SET EDPATH=%WATCOM%\EDDAT
|
|
||||||
SET HELP=%WATCOM%\BINP\HELP;%HELP%
|
|
||||||
SET BOOKSHELF=%WATCOM%\BINP\HELP;%BOOKSHELF%
|
|
||||||
SET BEGINLIBPATH=%WATCOM%\BINP\DLL
|
|
||||||
|
|
||||||
cmd
|
|
||||||
|
|
132
src/Makefile.wat
132
src/Makefile.wat
|
@ -1,132 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
dllname=SDL
|
|
||||||
|
|
||||||
audioobjs = audio\SDL_audio.obj audio\SDL_audiocvt.obj audio\SDL_audiomem.obj &
|
|
||||||
audio\SDL_mixer.obj audio\SDL_mixer_MMX_VC.obj audio\SDL_wave.obj &
|
|
||||||
audio\SDL_dart.obj
|
|
||||||
cdromobjs = cdrom\SDL_cdrom.obj cdrom\SDL_syscdrom.obj
|
|
||||||
cpuinfoobjs = cpuinfo\SDL_cpuinfo.obj
|
|
||||||
endianobjs = endian\SDL_endian.obj
|
|
||||||
eventsobjs = events\SDL_active.obj events\SDL_events.obj events\SDL_expose.obj &
|
|
||||||
events\SDL_keyboard.obj events\SDL_mouse.obj events\SDL_quit.obj &
|
|
||||||
events\SDL_resize.obj
|
|
||||||
fileobjs = file\SDL_rwops.obj
|
|
||||||
hermesobjs = hermes\mmx_main.obj hermes\mmxp2_32.obj hermes\x86_main.obj &
|
|
||||||
hermes\x86p_16.obj hermes\x86p_32.obj
|
|
||||||
joystickobjs = joystick\SDL_joystick.obj joystick\SDL_sysjoystick.obj
|
|
||||||
threadobjs = thread\SDL_thread.obj thread\SDL_sysmutex.obj &
|
|
||||||
thread\SDL_syssem.obj thread\SDL_systhread.obj &
|
|
||||||
thread\SDL_syscond.obj
|
|
||||||
timerobjs = timer\SDL_timer.obj timer\SDL_systimer.obj
|
|
||||||
videoobjs = video\SDL_blit.obj video\SDL_blit_0.obj video\SDL_blit_1.obj &
|
|
||||||
video\SDL_blit_A.obj video\SDL_blit_N.obj video\SDL_bmp.obj &
|
|
||||||
video\SDL_cursor.obj video\SDL_gamma.obj video\SDL_pixels.obj &
|
|
||||||
video\SDL_RLEaccel.obj video\SDL_stretch.obj video\SDL_surface.obj &
|
|
||||||
video\SDL_video.obj video\SDL_yuv.obj video\SDL_yuv_mmx.obj &
|
|
||||||
video\SDL_yuv_sw.obj video\SDL_os2fslib.obj
|
|
||||||
|
|
||||||
object_files= SDL.obj SDL_error.obj SDL_fatal.obj SDL_getenv.obj &
|
|
||||||
SDL_loadso.obj $(audioobjs) $(cpuinfoobjs) $(endianobjs) &
|
|
||||||
$(eventsobjs) $(fileobjs) $(joystickobjs) &
|
|
||||||
$(threadobjs) $(timerobjs) $(videoobjs) $(cdromobjs)
|
|
||||||
|
|
||||||
|
|
||||||
# Extra stuffs to pass to C compiler:
|
|
||||||
ExtraCFlags=
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
@set include=$(%os2tk)\h;$(%include);../include;./thread;./thread/os2;./video;./cdrom;./cdrom/os2;./joystick;./joystick/os2;
|
|
||||||
|
|
||||||
all : check_subdir_objects $(dllname).dll $(dllname).lib
|
|
||||||
|
|
||||||
$(dllname).dll : $(dllname).lnk $(object_files)
|
|
||||||
wlink @$(dllname)
|
|
||||||
|
|
||||||
check_subdir_objects: .always .symbolic
|
|
||||||
@cd audio
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\cdrom
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\cpuinfo
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\endian
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\events
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\file
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\joystick
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\thread
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\timer
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..\video
|
|
||||||
@wmake -h -f Makefile.wat
|
|
||||||
@cd ..
|
|
||||||
|
|
||||||
$(dllname).lnk :
|
|
||||||
@echo Creating linker file ($(dllname).lnk)...
|
|
||||||
@echo $#============================================================================= >$^@
|
|
||||||
@echo $# This is a linker file to build SDL.DLL for OS/2 >>$^@
|
|
||||||
@echo $# >>$^@
|
|
||||||
@echo $# Generated automatically by Makefile.wat >>$^@
|
|
||||||
@echo $#============================================================================= >>$^@
|
|
||||||
@echo SYSTEM 386 LX DLL INITINSTANCE TERMINSTANCE >>$^@
|
|
||||||
@echo NAME $^& >>$^@
|
|
||||||
@for %i in ($(object_files)) do @echo FILE %i >>$^@
|
|
||||||
@echo LIBPATH %os2tk%\lib >>$^@
|
|
||||||
@echo LIBPATH %fslib% >>$^@
|
|
||||||
@echo LIB mmpm2.lib >>$^@
|
|
||||||
@echo LIB fslib.lib >>$^@
|
|
||||||
@echo OPTION QUIET >>$^@
|
|
||||||
@echo OPTION MAP=$^&.map >>$^@
|
|
||||||
@echo OPTION DESCRIPTION 'Simple DirectMedia Layer v1.2.7' >>$^@
|
|
||||||
@echo OPTION ELIMINATE >>$^@
|
|
||||||
@echo OPTION MANYAUTODATA >>$^@
|
|
||||||
@echo OPTION OSNAME='OS/2 and eComStation' >>$^@
|
|
||||||
@echo OPTION SHOWDEAD >>$^@
|
|
||||||
@echo Linker file created!
|
|
||||||
|
|
||||||
$(dllname).lib : $(dllname).dll
|
|
||||||
implib $(dllname).lib $(dllname).dll
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.dll del *.dll
|
|
||||||
@if exist *.lib del *.lib
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.lnk del *.lnk
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
||||||
@cd audio
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\cdrom
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\cpuinfo
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\endian
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\events
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\file
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\joystick
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\thread
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\timer
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..\video
|
|
||||||
@wmake -h -f Makefile.wat clean
|
|
||||||
@cd ..
|
|
|
@ -1,27 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for DART (audio support)
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files= SDL_audio.obj SDL_audiocvt.obj SDL_audiomem.obj SDL_mixer.obj SDL_mixer_MMX_VC.obj SDL_wave.obj SDL_dart.obj
|
|
||||||
ExtraCFlags=-dUSE_ASM_MIXER_VC -dUSE_DOSSETPRIORITY
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include;./dart
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
SDL_dart.obj: .AUTODEPEND
|
|
||||||
wcc386 dart\SDL_dart.c $(cflags)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -181,10 +181,20 @@ int SDL_RunAudio(void *audiop)
|
||||||
// Increase the priority of this thread to make sure that
|
// Increase the priority of this thread to make sure that
|
||||||
// the audio will be continuous all the time!
|
// the audio will be continuous all the time!
|
||||||
#ifdef USE_DOSSETPRIORITY
|
#ifdef USE_DOSSETPRIORITY
|
||||||
|
if (SDL_getenv("SDL_USE_TIMECRITICAL_AUDIO"))
|
||||||
|
{
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID());
|
printf("[SDL_RunAudio] : Setting priority to TimeCritical+0! (TID%d)\n", SDL_ThreadID());
|
||||||
#endif
|
#endif
|
||||||
DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0);
|
DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef DEBUG_BUILD
|
||||||
|
printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID());
|
||||||
|
#endif
|
||||||
|
DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -134,8 +134,7 @@ void SDL_MixAudio (Uint8 *dst, const Uint8 *src, Uint32 len, int volume)
|
||||||
SDL_MixAudio_MMX_S8((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
SDL_MixAudio_MMX_S8((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
|
||||||
#if defined(_MSC_VER) && defined(M_I86) && defined(SDL_ASSEMBLY_ROUTINES)
|
|
||||||
if (SDL_HasMMX())
|
if (SDL_HasMMX())
|
||||||
{
|
{
|
||||||
SDL_MixAudio_MMX_S8_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
SDL_MixAudio_MMX_S8_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
||||||
|
@ -180,8 +179,8 @@ void SDL_MixAudio (Uint8 *dst, const Uint8 *src, Uint32 len, int volume)
|
||||||
{
|
{
|
||||||
SDL_MixAudio_MMX_S16((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
SDL_MixAudio_MMX_S16((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#elif defined(USE_ASM_MIXER_VC)
|
#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
|
||||||
if (SDL_HasMMX())
|
if (SDL_HasMMX())
|
||||||
{
|
{
|
||||||
SDL_MixAudio_MMX_S16_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
SDL_MixAudio_MMX_S16_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "SDL_mixer_MMX_VC.h"
|
#include "SDL_mixer_MMX_VC.h"
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(M_I86) && defined(SDL_ASSEMBLY_ROUTINES)
|
#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
|
||||||
// MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples
|
// MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples
|
||||||
// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
|
// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
|
||||||
// Converted to Intel ASM notation by Cth
|
// Converted to Intel ASM notation by Cth
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(M_I86) && defined(SDL_ASSEMBLY_ROUTINES)
|
#if ((defined(_MSC_VER) && defined(M_I86)) || (defined(__WATCOMC__))) && defined(SDL_ASSEMBLY_ROUTINES)
|
||||||
// headers for MMX assembler version of SDL_MixAudio
|
// headers for MMX assembler version of SDL_MixAudio
|
||||||
// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
|
// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
|
||||||
// Converted to Intel ASM notation by Cth
|
// Converted to Intel ASM notation by Cth
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for OS/2 System CDROM support
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=SDL_syscdrom.obj SDL_cdrom.obj
|
|
||||||
ExtraCFlags=
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include;./os2;../;
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
SDL_syscdrom.obj : .AUTODEPEND
|
|
||||||
wcc386 os2\SDL_syscdrom.c $(cflags)
|
|
||||||
|
|
||||||
SDL_cdrom.obj : .AUTODEPEND
|
|
||||||
wcc386 SDL_cdrom.c $(cflags)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -293,7 +293,7 @@ if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp
|
||||||
if (msp.ulReturn == MCI_MODE_PAUSE)
|
if (msp.ulReturn == MCI_MODE_PAUSE)
|
||||||
{
|
{
|
||||||
mgp.hwndCallback = (HWND)NULL; // None
|
mgp.hwndCallback = (HWND)NULL; // None
|
||||||
mciSendCommand(cdrom->id,MCI_RESUME,NULL,&mgp, 0);
|
mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Now play it. */
|
/* Now play it. */
|
||||||
|
@ -338,7 +338,7 @@ if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp
|
||||||
if (msp.ulReturn == MCI_MODE_PAUSE)
|
if (msp.ulReturn == MCI_MODE_PAUSE)
|
||||||
{
|
{
|
||||||
mgp.hwndCallback = (HWND)NULL; // None
|
mgp.hwndCallback = (HWND)NULL; // None
|
||||||
mciSendCommand(cdrom->id,MCI_RESUME,NULL,&mgp, 0);
|
mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Now stops the media */
|
/* Now stops the media */
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for cpuinfo
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=SDL_cpuinfo.obj
|
|
||||||
|
|
||||||
# We have to define the following so the assembly parts can be
|
|
||||||
# compiled by Watcom, too!
|
|
||||||
ExtraCFlags=-d_MSC_VER
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -96,7 +96,7 @@ CPUid by definition. But it's nice to be able to prove it. :) */
|
||||||
:
|
:
|
||||||
: "%rax", "%rcx"
|
: "%rax", "%rcx"
|
||||||
);
|
);
|
||||||
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_X86_))
|
#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
|
||||||
__asm {
|
__asm {
|
||||||
pushfd ; Get original EFLAGS
|
pushfd ; Get original EFLAGS
|
||||||
pop eax
|
pop eax
|
||||||
|
@ -165,7 +165,7 @@ static __inline__ int CPU_getCPUIDFeatures(void)
|
||||||
:
|
:
|
||||||
: "%eax", "%ecx", "%edx", "%edi"
|
: "%eax", "%ecx", "%edx", "%edi"
|
||||||
);
|
);
|
||||||
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_X86_))
|
#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
|
||||||
__asm {
|
__asm {
|
||||||
xor eax, eax ; Set up for CPUID instruction
|
xor eax, eax ; Set up for CPUID instruction
|
||||||
cpuid ; Get and save vendor ID
|
cpuid ; Get and save vendor ID
|
||||||
|
@ -217,7 +217,7 @@ static __inline__ int CPU_getCPUIDFeaturesExt(void)
|
||||||
:
|
:
|
||||||
: "%eax", "%ecx", "%edx", "%edi"
|
: "%eax", "%ecx", "%edx", "%edi"
|
||||||
);
|
);
|
||||||
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_X86_))
|
#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
|
||||||
__asm {
|
__asm {
|
||||||
mov eax,80000000h ; Query for extended functions
|
mov eax,80000000h ; Query for extended functions
|
||||||
cpuid ; Get extended function limit
|
cpuid ; Get extended function limit
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for events
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=SDL_active.obj SDL_events.obj SDL_expose.obj SDL_keyboard.obj SDL_mouse.obj SDL_quit.obj SDL_resize.obj
|
|
||||||
ExtraCFlags=-dUSE_DOSSETPRIORITY
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include;../timer;../joystick;../video;
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -176,7 +176,7 @@ printf("Mouse event didn't change state - dropped!\n");
|
||||||
SDL_MouseY = Y;
|
SDL_MouseY = Y;
|
||||||
SDL_DeltaX += Xrel;
|
SDL_DeltaX += Xrel;
|
||||||
SDL_DeltaY += Yrel;
|
SDL_DeltaY += Yrel;
|
||||||
SDL_MoveCursor(SDL_MouseX, SDL_MouseY);
|
SDL_MoveCursor(SDL_MouseX, SDL_MouseY);
|
||||||
|
|
||||||
/* Post the event, if desired */
|
/* Post the event, if desired */
|
||||||
posted = 0;
|
posted = 0;
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for file
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=SDL_rwops.obj
|
|
||||||
ExtraCFlags=
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -1,27 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for joystick (using the dummy joystick driver)
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=SDL_joystick.obj SDL_sysjoystick.obj
|
|
||||||
ExtraCFlags=
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include;./os2;../;../events;
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
SDL_sysjoystick.obj: .AUTODEPEND
|
|
||||||
wcc386 os2\SDL_sysjoystick.c $(cflags)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "joyos2.h"
|
#include "joyos2.h"
|
||||||
|
|
||||||
#include "SDL_joystick.h"
|
#include "SDL_joystick.h"
|
||||||
|
#include "SDL_events.h"
|
||||||
#include "../SDL_sysjoystick.h"
|
#include "../SDL_sysjoystick.h"
|
||||||
#include "../SDL_joystick_c.h"
|
#include "../SDL_joystick_c.h"
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@ HFILE hJoyPort = NULL; /* Joystick GAME$ Port Address */
|
||||||
#define JOY_BUTTON_FLAG(n) (1<<n)
|
#define JOY_BUTTON_FLAG(n) (1<<n)
|
||||||
|
|
||||||
/* Joystick data... hold information about detected devices */
|
/* Joystick data... hold information about detected devices */
|
||||||
struct _SYS_JoyData
|
typedef struct SYS_JoyData_s
|
||||||
{
|
{
|
||||||
Sint8 id; // Device ID
|
Sint8 id; // Device ID
|
||||||
char szDeviceName[MAX_JOYNAME]; // Device Name
|
char szDeviceName[MAX_JOYNAME]; // Device Name
|
||||||
|
@ -62,7 +63,9 @@ int axes_min[MAX_AXES]; // minimum callibration value for axes
|
||||||
int axes_med[MAX_AXES]; // medium callibration value for axes
|
int axes_med[MAX_AXES]; // medium callibration value for axes
|
||||||
int axes_max[MAX_AXES]; // maximum callibration value for axes
|
int axes_max[MAX_AXES]; // maximum callibration value for axes
|
||||||
int buttoncalc[4]; // Used for buttons 5, 6, 7 and 8.
|
int buttoncalc[4]; // Used for buttons 5, 6, 7 and 8.
|
||||||
} SYS_JoyData[MAX_JOYSTICKS];
|
} SYS_JoyData_t, *SYS_JoyData_p;
|
||||||
|
|
||||||
|
SYS_JoyData_t SYS_JoyData[MAX_JOYSTICKS];
|
||||||
|
|
||||||
|
|
||||||
/* Structure used to convert data from OS/2 driver format to SDL format */
|
/* Structure used to convert data from OS/2 driver format to SDL format */
|
||||||
|
@ -292,16 +295,16 @@ if (numdevs > 0)
|
||||||
}
|
}
|
||||||
/* Hack to define Joystick Port Names */
|
/* Hack to define Joystick Port Names */
|
||||||
if ( numdevs > maxdevs ) numdevs = maxdevs;
|
if ( numdevs > maxdevs ) numdevs = maxdevs;
|
||||||
for (i=0; i<numdevs; i++) {
|
for (i=0; i<numdevs; i++)
|
||||||
SDL_snprintf (SYS_JoyData[i].szDeviceName, SDL_arraysize(szDeviceName), "Default Joystick %c", 'A'+SYS_JoyData[i].id);
|
SDL_snprintf (SYS_JoyData[i].szDeviceName, SDL_arraysize(SYS_JoyData[i].szDeviceName), "Default Joystick %c", 'A'+SYS_JoyData[i].id);
|
||||||
}
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Return the number of devices found */
|
/* Return the number of devices found */
|
||||||
return(numdevs);
|
return(numdevs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
/* Function to get the device-dependent name of a joystick */
|
/* Function to get the device-dependent name of a joystick */
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for threading
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=SDL_thread.obj SDL_sysmutex.obj SDL_syssem.obj SDL_systhread.obj SDL_syscond.obj
|
|
||||||
ExtraCFlags=
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include;./os2;../;
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
SDL_sysmutex.obj: .AUTODEPEND
|
|
||||||
wcc386 os2\SDL_sysmutex.c $(cflags)
|
|
||||||
|
|
||||||
SDL_syssem.obj: .AUTODEPEND
|
|
||||||
wcc386 os2\SDL_syssem.c $(cflags)
|
|
||||||
|
|
||||||
SDL_systhread.obj: .AUTODEPEND
|
|
||||||
wcc386 os2\SDL_systhread.c $(cflags)
|
|
||||||
|
|
||||||
SDL_syscond.obj: .AUTODEPEND
|
|
||||||
wcc386 os2\SDL_syscond.c $(cflags)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include "SDL_thread.h"
|
#include "SDL_thread.h"
|
||||||
#include "../SDL_systhread.h"
|
#include "../SDL_systhread.h"
|
||||||
|
#include "../SDL_thread_c.h"
|
||||||
|
|
||||||
typedef struct ThreadStartParms
|
typedef struct ThreadStartParms
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for timers
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=SDL_timer.obj SDL_systimer.obj
|
|
||||||
ExtraCFlags=
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include;./os2;../;
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
SDL_systimer.obj: .AUTODEPEND
|
|
||||||
wcc386 os2\SDL_systimer.c $(cflags)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -1,27 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for threading
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
object_files=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_os2fslib.obj
|
|
||||||
ExtraCFlags=-dUSE_DOSSETPRIORITY
|
|
||||||
|
|
||||||
#
|
|
||||||
#==============================================================================
|
|
||||||
#
|
|
||||||
!include ..\..\Watcom.mif
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../../include;../;./os2;../events;../hermes;$(%FSLIB);
|
|
||||||
|
|
||||||
all : $(object_files)
|
|
||||||
|
|
||||||
SDL_os2fslib.obj : .AUTODEPEND
|
|
||||||
wcc386 os2fslib\SDL_os2fslib.c $(cflags)
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
|
@ -35,6 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if ((defined(_MFC_VER) && defined(_M_IX86)/* && !defined(_WIN32_WCE) still needed? */) || \
|
#if ((defined(_MFC_VER) && defined(_M_IX86)/* && !defined(_WIN32_WCE) still needed? */) || \
|
||||||
|
defined(__WATCOMC__) || \
|
||||||
(defined(__GNUC__) && defined(__i386__))) && SDL_ASSEMBLY_ROUTINES
|
(defined(__GNUC__) && defined(__i386__))) && SDL_ASSEMBLY_ROUTINES
|
||||||
#define USE_ASM_STRETCH
|
#define USE_ASM_STRETCH
|
||||||
#endif
|
#endif
|
||||||
|
@ -281,8 +282,7 @@ int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
|
||||||
: "=&D" (u1), "=&S" (u2)
|
: "=&D" (u1), "=&S" (u2)
|
||||||
: "0" (dstp), "1" (srcp), "r" (copy_row)
|
: "0" (dstp), "1" (srcp), "r" (copy_row)
|
||||||
: "memory" );
|
: "memory" );
|
||||||
#else
|
#elif defined(_MSC_VER) || defined(__WATCOMC__)
|
||||||
#ifdef _MSC_VER
|
|
||||||
{ void *code = copy_row;
|
{ void *code = copy_row;
|
||||||
__asm {
|
__asm {
|
||||||
push edi
|
push edi
|
||||||
|
@ -299,7 +299,6 @@ int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
|
||||||
#else
|
#else
|
||||||
#error Need inline assembly for this compiler
|
#error Need inline assembly for this compiler
|
||||||
#endif
|
#endif
|
||||||
#endif /* __GNUC__ */
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -21,6 +21,11 @@
|
||||||
*/
|
*/
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
|
|
||||||
|
#define _ULS_CALLCONV_
|
||||||
|
#define CALLCONV _System
|
||||||
|
#include <unidef.h> // Unicode API
|
||||||
|
#include <uconv.h> // Unicode API (codepage conversion)
|
||||||
|
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
@ -115,8 +120,8 @@ static int iShiftIsPressed;
|
||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
static BOOL SetAccessableWindowPos(HWND hwnd, HWND hwndInsertBehind,
|
static BOOL SetAccessableWindowPos(HWND hwnd, HWND hwndInsertBehind,
|
||||||
LONG x, LONG y,
|
LONG x, LONG y,
|
||||||
LONG cx, LONG cy,
|
LONG cx, LONG cy,
|
||||||
ULONG fl)
|
ULONG fl)
|
||||||
{
|
{
|
||||||
SWP swpDesktop, swp;
|
SWP swpDesktop, swp;
|
||||||
|
@ -169,6 +174,58 @@ static BOOL SetAccessableWindowPos(HWND hwnd, HWND hwndInsertBehind,
|
||||||
return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
|
return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static UniChar NativeCharToUniChar(int chcode)
|
||||||
|
{
|
||||||
|
UniChar ucResult = (UniChar) chcode;
|
||||||
|
int rc;
|
||||||
|
UconvObject ucoTemp;
|
||||||
|
char achFrom[2];
|
||||||
|
char *pchFrom;
|
||||||
|
size_t iFromCount;
|
||||||
|
UniChar aucTo[10];
|
||||||
|
UniChar *pucTo;
|
||||||
|
size_t iToCount;
|
||||||
|
size_t iNonIdentical;
|
||||||
|
|
||||||
|
// Create unicode convert object
|
||||||
|
rc = UniCreateUconvObject(L"", &ucoTemp);
|
||||||
|
if (rc!=ULS_SUCCESS)
|
||||||
|
{
|
||||||
|
// Could not create convert object!
|
||||||
|
return ucResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert language code string to unicode string
|
||||||
|
achFrom[0] = (char) chcode;
|
||||||
|
achFrom[1] = 0;
|
||||||
|
iFromCount = sizeof(char) * 2;
|
||||||
|
iToCount = sizeof(UniChar) * 2;
|
||||||
|
pucTo = &(aucTo[0]);
|
||||||
|
pchFrom = &(achFrom[0]);
|
||||||
|
|
||||||
|
rc = UniUconvToUcs(ucoTemp,
|
||||||
|
&pchFrom,
|
||||||
|
&iFromCount,
|
||||||
|
&pucTo,
|
||||||
|
&iToCount,
|
||||||
|
&iNonIdentical);
|
||||||
|
|
||||||
|
if (rc!=ULS_SUCCESS)
|
||||||
|
{
|
||||||
|
// Could not convert language code to UCS string!
|
||||||
|
UniFreeUconvObject(ucoTemp);
|
||||||
|
return ucResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
UniFreeUconvObject(ucoTemp);
|
||||||
|
|
||||||
|
#ifdef DEBUG_BUILD
|
||||||
|
printf("%02x converted to %02x\n", (int) chcode, (int) (aucTo[0]));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return aucTo[0];
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// TranslateKey
|
// TranslateKey
|
||||||
|
@ -184,10 +241,8 @@ static SDL_keysym *TranslateKey(int vkey, int chcode, int scancode, SDL_keysym *
|
||||||
|
|
||||||
if (iPressed && SDL_TranslateUNICODE)
|
if (iPressed && SDL_TranslateUNICODE)
|
||||||
{
|
{
|
||||||
// TODO:
|
|
||||||
// Implement real unicode conversion!
|
|
||||||
if (chcode)
|
if (chcode)
|
||||||
keysym->unicode = chcode;
|
keysym->unicode = NativeCharToUniChar(chcode);
|
||||||
else
|
else
|
||||||
keysym->unicode = vkey;
|
keysym->unicode = vkey;
|
||||||
}
|
}
|
||||||
|
@ -207,74 +262,74 @@ static SDL_keysym *TranslateKey(int vkey, int chcode, int scancode, SDL_keysym *
|
||||||
switch (keysym->sym)
|
switch (keysym->sym)
|
||||||
{
|
{
|
||||||
case SDLK_BACKQUOTE:
|
case SDLK_BACKQUOTE:
|
||||||
keysym->sym = '~';
|
keysym->sym = '~';
|
||||||
break;
|
break;
|
||||||
case SDLK_1:
|
case SDLK_1:
|
||||||
keysym->sym = SDLK_EXCLAIM;
|
keysym->sym = SDLK_EXCLAIM;
|
||||||
break;
|
break;
|
||||||
case SDLK_2:
|
case SDLK_2:
|
||||||
keysym->sym = SDLK_AT;
|
keysym->sym = SDLK_AT;
|
||||||
break;
|
break;
|
||||||
case SDLK_3:
|
case SDLK_3:
|
||||||
keysym->sym = SDLK_HASH;
|
keysym->sym = SDLK_HASH;
|
||||||
break;
|
break;
|
||||||
case SDLK_4:
|
case SDLK_4:
|
||||||
keysym->sym = SDLK_DOLLAR;
|
keysym->sym = SDLK_DOLLAR;
|
||||||
break;
|
break;
|
||||||
case SDLK_5:
|
case SDLK_5:
|
||||||
keysym->sym = '%';
|
keysym->sym = '%';
|
||||||
break;
|
break;
|
||||||
case SDLK_6:
|
case SDLK_6:
|
||||||
keysym->sym = SDLK_CARET;
|
keysym->sym = SDLK_CARET;
|
||||||
break;
|
break;
|
||||||
case SDLK_7:
|
case SDLK_7:
|
||||||
keysym->sym = SDLK_AMPERSAND;
|
keysym->sym = SDLK_AMPERSAND;
|
||||||
break;
|
break;
|
||||||
case SDLK_8:
|
case SDLK_8:
|
||||||
keysym->sym = SDLK_ASTERISK;
|
keysym->sym = SDLK_ASTERISK;
|
||||||
break;
|
break;
|
||||||
case SDLK_9:
|
case SDLK_9:
|
||||||
keysym->sym = SDLK_LEFTPAREN;
|
keysym->sym = SDLK_LEFTPAREN;
|
||||||
break;
|
break;
|
||||||
case SDLK_0:
|
case SDLK_0:
|
||||||
keysym->sym = SDLK_RIGHTPAREN;
|
keysym->sym = SDLK_RIGHTPAREN;
|
||||||
break;
|
break;
|
||||||
case SDLK_MINUS:
|
case SDLK_MINUS:
|
||||||
keysym->sym = SDLK_UNDERSCORE;
|
keysym->sym = SDLK_UNDERSCORE;
|
||||||
break;
|
break;
|
||||||
case SDLK_PLUS:
|
case SDLK_PLUS:
|
||||||
keysym->sym = SDLK_EQUALS;
|
keysym->sym = SDLK_EQUALS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_LEFTBRACKET:
|
case SDLK_LEFTBRACKET:
|
||||||
keysym->sym = '{';
|
keysym->sym = '{';
|
||||||
break;
|
break;
|
||||||
case SDLK_RIGHTBRACKET:
|
case SDLK_RIGHTBRACKET:
|
||||||
keysym->sym = '}';
|
keysym->sym = '}';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_SEMICOLON:
|
case SDLK_SEMICOLON:
|
||||||
keysym->sym = SDLK_COLON;
|
keysym->sym = SDLK_COLON;
|
||||||
break;
|
break;
|
||||||
case SDLK_QUOTE:
|
case SDLK_QUOTE:
|
||||||
keysym->sym = SDLK_QUOTEDBL;
|
keysym->sym = SDLK_QUOTEDBL;
|
||||||
break;
|
break;
|
||||||
case SDLK_BACKSLASH:
|
case SDLK_BACKSLASH:
|
||||||
keysym->sym = '|';
|
keysym->sym = '|';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_COMMA:
|
case SDLK_COMMA:
|
||||||
keysym->sym = SDLK_LESS;
|
keysym->sym = SDLK_LESS;
|
||||||
break;
|
break;
|
||||||
case SDLK_PERIOD:
|
case SDLK_PERIOD:
|
||||||
keysym->sym = SDLK_GREATER;
|
keysym->sym = SDLK_GREATER;
|
||||||
break;
|
break;
|
||||||
case SDLK_SLASH:
|
case SDLK_SLASH:
|
||||||
keysym->sym = SDLK_QUESTION;
|
keysym->sym = SDLK_QUESTION;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return keysym;
|
return keysym;
|
||||||
|
@ -283,33 +338,33 @@ static SDL_keysym *TranslateKey(int vkey, int chcode, int scancode, SDL_keysym *
|
||||||
#define CONVERTMOUSEPOSITION() \
|
#define CONVERTMOUSEPOSITION() \
|
||||||
/* We have to inverse the mouse position, because every non-os/2 system */ \
|
/* We have to inverse the mouse position, because every non-os/2 system */ \
|
||||||
/* has a coordinate system where the (0;0) is the top-left corner, */ \
|
/* has a coordinate system where the (0;0) is the top-left corner, */ \
|
||||||
/* while on os/2 it's the bottom left corner! */ \
|
/* while on os/2 it's the bottom left corner! */ \
|
||||||
if (FSLib_QueryFSMode(hwnd)) \
|
if (FSLib_QueryFSMode(hwnd)) \
|
||||||
{ \
|
{ \
|
||||||
/* We're in FS mode! */ \
|
/* We're in FS mode! */ \
|
||||||
/* In FS mode our window is as big as fullscreen mode, but not necessary as */ \
|
/* In FS mode our window is as big as fullscreen mode, but not necessary as */ \
|
||||||
/* big as the source buffer (can be bigger) */ \
|
/* big as the source buffer (can be bigger) */ \
|
||||||
/* So, limit mouse pos to source buffer size! */ \
|
/* So, limit mouse pos to source buffer size! */ \
|
||||||
if (ppts->x<0) ppts->x = 0; \
|
if (ppts->x<0) ppts->x = 0; \
|
||||||
if (ppts->y<0) ppts->y = 0; \
|
if (ppts->y<0) ppts->y = 0; \
|
||||||
if (ppts->x>=pVideo->hidden->SrcBufferDesc.uiXResolution) ppts->x = pVideo->hidden->SrcBufferDesc.uiXResolution-1; \
|
if (ppts->x>=pVideo->hidden->SrcBufferDesc.uiXResolution) ppts->x = pVideo->hidden->SrcBufferDesc.uiXResolution-1; \
|
||||||
if (ppts->y>=pVideo->hidden->SrcBufferDesc.uiYResolution) ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution-1; \
|
if (ppts->y>=pVideo->hidden->SrcBufferDesc.uiYResolution) ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution-1; \
|
||||||
pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */ \
|
pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */ \
|
||||||
ptl.x = ppts->x; ptl.y = ppts->y; \
|
ptl.x = ppts->x; ptl.y = ppts->y; \
|
||||||
WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1); \
|
WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1); \
|
||||||
WinSetPointerPos(HWND_DESKTOP, ptl.x, ptl.y); \
|
WinSetPointerPos(HWND_DESKTOP, ptl.x, ptl.y); \
|
||||||
/* Then convert OS/2 position to SDL position */ \
|
/* Then convert OS/2 position to SDL position */ \
|
||||||
ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution - ppts->y - 1; \
|
ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution - ppts->y - 1; \
|
||||||
} else \
|
} else \
|
||||||
{ \
|
{ \
|
||||||
SWP swpClient; \
|
SWP swpClient; \
|
||||||
/* We're in windowed mode! */ \
|
/* We're in windowed mode! */ \
|
||||||
WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient); \
|
WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient); \
|
||||||
/* Convert OS/2 mouse position to SDL position, and also scale it! */ \
|
/* Convert OS/2 mouse position to SDL position, and also scale it! */ \
|
||||||
(ppts->x) = (ppts->x) * pVideo->hidden->SrcBufferDesc.uiXResolution / swpClient.cx; \
|
(ppts->x) = (ppts->x) * pVideo->hidden->SrcBufferDesc.uiXResolution / swpClient.cx; \
|
||||||
(ppts->y) = (ppts->y) * pVideo->hidden->SrcBufferDesc.uiYResolution / swpClient.cy; \
|
(ppts->y) = (ppts->y) * pVideo->hidden->SrcBufferDesc.uiYResolution / swpClient.cy; \
|
||||||
(ppts->y) = pVideo->hidden->SrcBufferDesc.uiYResolution - (ppts->y) - 1; \
|
(ppts->y) = pVideo->hidden->SrcBufferDesc.uiYResolution - (ppts->y) - 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -351,9 +406,9 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// If it's not repeated, then let's see if its pressed or released!
|
// If it's not repeated, then let's see if its pressed or released!
|
||||||
if (SHORT1FROMMP(mp1) & KC_KEYUP)
|
if (SHORT1FROMMP(mp1) & KC_KEYUP)
|
||||||
{
|
{
|
||||||
// A key has been released
|
// A key has been released
|
||||||
SDL_keysym keysym;
|
SDL_keysym keysym;
|
||||||
|
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
|
@ -362,10 +417,10 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
|
|
||||||
// One problem is with F1, which gets only the keyup message because
|
// One problem is with F1, which gets only the keyup message because
|
||||||
// it is a system key.
|
// it is a system key.
|
||||||
// So, when we get keyup message, we simulate keydown too!
|
// So, when we get keyup message, we simulate keydown too!
|
||||||
// UPDATE:
|
// UPDATE:
|
||||||
// This problem should be solved now, that the accelerator keys are
|
// This problem should be solved now, that the accelerator keys are
|
||||||
// disabled for this window!
|
// disabled for this window!
|
||||||
/*
|
/*
|
||||||
if (SHORT2FROMMP(mp2)==VK_F1)
|
if (SHORT2FROMMP(mp2)==VK_F1)
|
||||||
{
|
{
|
||||||
|
@ -373,45 +428,45 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
SHORT1FROMMP(mp2), // Character code
|
SHORT1FROMMP(mp2), // Character code
|
||||||
CHAR4FROMMP(mp1), // HW Scan code
|
CHAR4FROMMP(mp1), // HW Scan code
|
||||||
&keysym,0));
|
&keysym,0));
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
|
SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
|
||||||
SHORT1FROMMP(mp2), // Character code
|
SHORT1FROMMP(mp2), // Character code
|
||||||
CHAR4FROMMP(mp1), // HW Scan code
|
CHAR4FROMMP(mp1), // HW Scan code
|
||||||
&keysym,0));
|
&keysym,0));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// A key has been pressed
|
// A key has been pressed
|
||||||
SDL_keysym keysym;
|
SDL_keysym keysym;
|
||||||
|
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
// printf("WM_CHAR, keydown, code is [0x%0x]\n", CHAR4FROMMP(mp1)); // HW scan code
|
// printf("WM_CHAR, keydown, code is [0x%0x]\n", CHAR4FROMMP(mp1)); // HW scan code
|
||||||
#endif
|
#endif
|
||||||
// Check for fastkeys: ALT+HOME to toggle FS mode
|
// Check for fastkeys: ALT+HOME to toggle FS mode
|
||||||
// ALT+END to close app
|
// ALT+END to close app
|
||||||
if ((SHORT1FROMMP(mp1) & KC_ALT) &&
|
if ((SHORT1FROMMP(mp1) & KC_ALT) &&
|
||||||
(SHORT2FROMMP(mp2) == VK_HOME))
|
(SHORT2FROMMP(mp2) == VK_HOME))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
printf(" Pressed ALT+HOME!\n"); fflush(stdout);
|
printf(" Pressed ALT+HOME!\n"); fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
// Only switch between fullscreen and back if it's not
|
// Only switch between fullscreen and back if it's not
|
||||||
// a resizable mode!
|
// a resizable mode!
|
||||||
if (
|
if (
|
||||||
(!pVideo->hidden->pSDLSurface) ||
|
(!pVideo->hidden->pSDLSurface) ||
|
||||||
((pVideo->hidden->pSDLSurface)
|
((pVideo->hidden->pSDLSurface)
|
||||||
&& ((pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE)==0)
|
&& ((pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE)==0)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
FSLib_ToggleFSMode(hwnd, !FSLib_QueryFSMode(hwnd));
|
FSLib_ToggleFSMode(hwnd, !FSLib_QueryFSMode(hwnd));
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
else
|
else
|
||||||
printf(" Resizable mode, so discarding ALT+HOME!\n"); fflush(stdout);
|
printf(" Resizable mode, so discarding ALT+HOME!\n"); fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
if ((SHORT1FROMMP(mp1) & KC_ALT) &&
|
if ((SHORT1FROMMP(mp1) & KC_ALT) &&
|
||||||
(SHORT2FROMMP(mp2) == VK_END))
|
(SHORT2FROMMP(mp2) == VK_END))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
printf(" Pressed ALT+END!\n"); fflush(stdout);
|
printf(" Pressed ALT+END!\n"); fflush(stdout);
|
||||||
|
@ -421,32 +476,32 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
// wait for it to be processed!
|
// wait for it to be processed!
|
||||||
SDL_PrivateQuit();
|
SDL_PrivateQuit();
|
||||||
WinPostMsg(hwnd, WM_QUIT, 0, 0);
|
WinPostMsg(hwnd, WM_QUIT, 0, 0);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
|
||||||
SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
|
SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
|
||||||
SHORT1FROMMP(mp2), // Character code
|
SHORT1FROMMP(mp2), // Character code
|
||||||
CHAR4FROMMP(mp1), // HW Scan code
|
CHAR4FROMMP(mp1), // HW Scan code
|
||||||
&keysym,1));
|
&keysym,1));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (MRESULT) TRUE;
|
return (MRESULT) TRUE;
|
||||||
|
|
||||||
case WM_TRANSLATEACCEL:
|
case WM_TRANSLATEACCEL:
|
||||||
{
|
{
|
||||||
PQMSG pqmsg;
|
PQMSG pqmsg;
|
||||||
pqmsg = (PQMSG) mp1;
|
pqmsg = (PQMSG) mp1;
|
||||||
if (mp1)
|
if (mp1)
|
||||||
{
|
{
|
||||||
if (pqmsg->msg == WM_CHAR)
|
if (pqmsg->msg == WM_CHAR)
|
||||||
{
|
{
|
||||||
// WM_CHAR message!
|
// WM_CHAR message!
|
||||||
// Let's filter the ALT keypress and all other acceleration keys!
|
// Let's filter the ALT keypress and all other acceleration keys!
|
||||||
return (MRESULT) FALSE;
|
return (MRESULT) FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break; // Default processing (pass to parent until frame control)
|
break; // Default processing (pass to parent until frame control)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,7 +615,7 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("WM_PAINT : No pVideo!\n"); fflush(stdout);
|
printf("WM_PAINT : No pVideo!\n"); fflush(stdout);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
WinEndPaint(ps);
|
WinEndPaint(ps);
|
||||||
|
@ -573,14 +628,14 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
printf("WM_SIZE : (%d %d)\n",
|
printf("WM_SIZE : (%d %d)\n",
|
||||||
SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); fflush(stdout);
|
SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
iWindowSizeX = SHORT1FROMMP(mp2);
|
iWindowSizeX = SHORT1FROMMP(mp2);
|
||||||
iWindowSizeY = SHORT2FROMMP(mp2);
|
iWindowSizeY = SHORT2FROMMP(mp2);
|
||||||
bWindowResized = 1;
|
bWindowResized = 1;
|
||||||
|
|
||||||
// Make sure the window will be redrawn
|
// Make sure the window will be redrawn
|
||||||
WinInvalidateRegion(hwnd, NULL, TRUE);
|
WinInvalidateRegion(hwnd, NULL, TRUE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -591,9 +646,9 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
#endif
|
#endif
|
||||||
if ((int)mp1 == FSLN_TOGGLEFSMODE)
|
if ((int)mp1 == FSLN_TOGGLEFSMODE)
|
||||||
{
|
{
|
||||||
// FS mode changed, reblit image!
|
// FS mode changed, reblit image!
|
||||||
pVideo = FSLib_GetUserParm(hwnd);
|
pVideo = FSLib_GetUserParm(hwnd);
|
||||||
if (pVideo)
|
if (pVideo)
|
||||||
{
|
{
|
||||||
if (!pVideo->hidden->pSDLSurface)
|
if (!pVideo->hidden->pSDLSurface)
|
||||||
{
|
{
|
||||||
|
@ -651,7 +706,7 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
|
DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (MPARAM) 1;
|
return (MPARAM) 1;
|
||||||
|
|
||||||
|
@ -670,12 +725,12 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
if ((pVideo->hidden->iMouseVisible) && (!bMouseCaptured))
|
if ((pVideo->hidden->iMouseVisible) && (!bMouseCaptured))
|
||||||
WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
|
WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
|
||||||
else
|
else
|
||||||
WinSetPointer(HWND_DESKTOP, NULL);
|
WinSetPointer(HWND_DESKTOP, NULL);
|
||||||
|
|
||||||
if (bMouseCapturable)
|
if (bMouseCapturable)
|
||||||
{
|
{
|
||||||
// Re-capture the mouse, if we captured it before!
|
// Re-capture the mouse, if we captured it before!
|
||||||
WinSetCapture(HWND_DESKTOP, hwnd);
|
WinSetCapture(HWND_DESKTOP, hwnd);
|
||||||
bMouseCaptured = 1;
|
bMouseCaptured = 1;
|
||||||
{
|
{
|
||||||
SWP swpClient;
|
SWP swpClient;
|
||||||
|
@ -689,18 +744,18 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
ptl.x + swpClient.cx/2,
|
ptl.x + swpClient.cx/2,
|
||||||
ptl.y + swpClient.cy/2);
|
ptl.y + swpClient.cy/2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// Went out of focus
|
// Went out of focus
|
||||||
WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
|
WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
|
||||||
|
|
||||||
if (bMouseCaptured)
|
if (bMouseCaptured)
|
||||||
{
|
{
|
||||||
// Release the mouse
|
// Release the mouse
|
||||||
WinSetCapture(HWND_DESKTOP, hwnd);
|
WinSetCapture(HWND_DESKTOP, hwnd);
|
||||||
bMouseCaptured = 0;
|
bMouseCaptured = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
|
@ -717,16 +772,16 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
pVideo = FSLib_GetUserParm(hwnd);
|
pVideo = FSLib_GetUserParm(hwnd);
|
||||||
if (pVideo)
|
if (pVideo)
|
||||||
{
|
{
|
||||||
SDL_PrivateMouseButton(SDL_PRESSED,
|
SDL_PrivateMouseButton(SDL_PRESSED,
|
||||||
SDL_BUTTON_LEFT,
|
SDL_BUTTON_LEFT,
|
||||||
0, 0); // Don't report mouse movement!
|
0, 0); // Don't report mouse movement!
|
||||||
|
|
||||||
if (bMouseCapturable)
|
if (bMouseCapturable)
|
||||||
{
|
{
|
||||||
// We should capture the mouse!
|
// We should capture the mouse!
|
||||||
if (!bMouseCaptured)
|
if (!bMouseCaptured)
|
||||||
{
|
{
|
||||||
WinSetCapture(HWND_DESKTOP, hwnd);
|
WinSetCapture(HWND_DESKTOP, hwnd);
|
||||||
WinSetPointer(HWND_DESKTOP, NULL);
|
WinSetPointer(HWND_DESKTOP, NULL);
|
||||||
bMouseCaptured = 1;
|
bMouseCaptured = 1;
|
||||||
{
|
{
|
||||||
|
@ -741,8 +796,8 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
ptl.x + swpClient.cx/2,
|
ptl.x + swpClient.cx/2,
|
||||||
ptl.y + swpClient.cy/2);
|
ptl.y + swpClient.cy/2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_BUTTON1UP:
|
case WM_BUTTON1UP:
|
||||||
|
@ -761,16 +816,16 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
pVideo = FSLib_GetUserParm(hwnd);
|
pVideo = FSLib_GetUserParm(hwnd);
|
||||||
if (pVideo)
|
if (pVideo)
|
||||||
{
|
{
|
||||||
SDL_PrivateMouseButton(SDL_PRESSED,
|
SDL_PrivateMouseButton(SDL_PRESSED,
|
||||||
SDL_BUTTON_RIGHT,
|
SDL_BUTTON_RIGHT,
|
||||||
0, 0); // Don't report mouse movement!
|
0, 0); // Don't report mouse movement!
|
||||||
|
|
||||||
if (bMouseCapturable)
|
if (bMouseCapturable)
|
||||||
{
|
{
|
||||||
// We should capture the mouse!
|
// We should capture the mouse!
|
||||||
if (!bMouseCaptured)
|
if (!bMouseCaptured)
|
||||||
{
|
{
|
||||||
WinSetCapture(HWND_DESKTOP, hwnd);
|
WinSetCapture(HWND_DESKTOP, hwnd);
|
||||||
WinSetPointer(HWND_DESKTOP, NULL);
|
WinSetPointer(HWND_DESKTOP, NULL);
|
||||||
bMouseCaptured = 1;
|
bMouseCaptured = 1;
|
||||||
{
|
{
|
||||||
|
@ -785,8 +840,8 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
ptl.x + swpClient.cx/2,
|
ptl.x + swpClient.cx/2,
|
||||||
ptl.y + swpClient.cy/2);
|
ptl.y + swpClient.cy/2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -810,12 +865,12 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
SDL_BUTTON_MIDDLE,
|
SDL_BUTTON_MIDDLE,
|
||||||
0, 0); // Don't report mouse movement!
|
0, 0); // Don't report mouse movement!
|
||||||
|
|
||||||
if (bMouseCapturable)
|
if (bMouseCapturable)
|
||||||
{
|
{
|
||||||
// We should capture the mouse!
|
// We should capture the mouse!
|
||||||
if (!bMouseCaptured)
|
if (!bMouseCaptured)
|
||||||
{
|
{
|
||||||
WinSetCapture(HWND_DESKTOP, hwnd);
|
WinSetCapture(HWND_DESKTOP, hwnd);
|
||||||
WinSetPointer(HWND_DESKTOP, NULL);
|
WinSetPointer(HWND_DESKTOP, NULL);
|
||||||
bMouseCaptured = 1;
|
bMouseCaptured = 1;
|
||||||
{
|
{
|
||||||
|
@ -830,8 +885,8 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
ptl.x + swpClient.cx/2,
|
ptl.x + swpClient.cx/2,
|
||||||
ptl.y + swpClient.cy/2);
|
ptl.y + swpClient.cy/2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_BUTTON3UP:
|
case WM_BUTTON3UP:
|
||||||
|
@ -858,19 +913,19 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
POINTS *ppts = (POINTS *) (&mp1);
|
POINTS *ppts = (POINTS *) (&mp1);
|
||||||
POINTL ptl;
|
POINTL ptl;
|
||||||
|
|
||||||
CONVERTMOUSEPOSITION();
|
|
||||||
|
|
||||||
if (bMouseCaptured)
|
if (bMouseCaptured)
|
||||||
{
|
{
|
||||||
SWP swpClient;
|
SWP swpClient;
|
||||||
|
|
||||||
|
WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
|
||||||
|
|
||||||
// Send relative mouse position, and re-center the mouse
|
// Send relative mouse position, and re-center the mouse
|
||||||
// Reposition the mouse to the center of the screen/window
|
// Reposition the mouse to the center of the screen/window
|
||||||
SDL_PrivateMouseMotion(0, // Buttons not changed
|
SDL_PrivateMouseMotion(0, // Buttons not changed
|
||||||
1, // Relative position
|
1, // Relative position
|
||||||
ppts->x - (pVideo->hidden->SrcBufferDesc.uiXResolution/2),
|
ppts->x - (swpClient.cx/2),
|
||||||
ppts->y+1 - (pVideo->hidden->SrcBufferDesc.uiYResolution/2));
|
(swpClient.cy/2) - ppts->y);
|
||||||
|
|
||||||
WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
|
|
||||||
ptl.x = 0; ptl.y = 0;
|
ptl.x = 0; ptl.y = 0;
|
||||||
WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
|
WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
|
||||||
pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
|
pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
|
||||||
|
@ -880,6 +935,8 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
ptl.y + swpClient.cy/2);
|
ptl.y + swpClient.cy/2);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
CONVERTMOUSEPOSITION();
|
||||||
|
|
||||||
// Send absolute mouse position
|
// Send absolute mouse position
|
||||||
SDL_PrivateMouseMotion(0, // Buttons not changed
|
SDL_PrivateMouseMotion(0, // Buttons not changed
|
||||||
0, // Absolute position
|
0, // Absolute position
|
||||||
|
@ -984,6 +1041,98 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// FrameWndProc
|
||||||
|
//
|
||||||
|
// This is the message processing window procedure for the
|
||||||
|
// frame window of SDLWindowClass.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
static MRESULT EXPENTRY FrameWndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
|
{
|
||||||
|
PFNWP pOldFrameProc;
|
||||||
|
MRESULT result;
|
||||||
|
PTRACKINFO ti;
|
||||||
|
int cx, cy, ncx, ncy;
|
||||||
|
RECTL rclTemp;
|
||||||
|
PSWP pswpTemp;
|
||||||
|
|
||||||
|
SDL_VideoDevice *pVideo = NULL;
|
||||||
|
|
||||||
|
pVideo = (SDL_VideoDevice *) WinQueryWindowULong(hwnd, QWL_USER);
|
||||||
|
|
||||||
|
pOldFrameProc = pVideo->hidden->pfnOldFrameProc;
|
||||||
|
|
||||||
|
if ((pVideo->hidden->bProportionalResize) &&
|
||||||
|
(msg==WM_ADJUSTWINDOWPOS) &&
|
||||||
|
(!FSLib_QueryFSMode(pVideo->hidden->hwndClient))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
pswpTemp = (PSWP) mp1;
|
||||||
|
|
||||||
|
/* Resizing? */
|
||||||
|
if (pswpTemp->fl & SWP_SIZE)
|
||||||
|
{
|
||||||
|
/* Calculate client size */
|
||||||
|
rclTemp.xLeft = pswpTemp->x;
|
||||||
|
rclTemp.xRight = pswpTemp->x + pswpTemp->cx;
|
||||||
|
rclTemp.yBottom = pswpTemp->y;
|
||||||
|
rclTemp.yTop = pswpTemp->y + pswpTemp->cy;
|
||||||
|
WinCalcFrameRect(hwnd, &rclTemp, TRUE);
|
||||||
|
|
||||||
|
ncx = cx = rclTemp.xRight - rclTemp.xLeft;
|
||||||
|
ncy = cy = rclTemp.yTop - rclTemp.yBottom;
|
||||||
|
|
||||||
|
/* Calculate new size to keep it proportional */
|
||||||
|
|
||||||
|
if ((pVideo->hidden->ulResizingFlag & TF_LEFT) || (pVideo->hidden->ulResizingFlag & TF_RIGHT))
|
||||||
|
{
|
||||||
|
/* The window is resized horizontally */
|
||||||
|
ncy = pVideo->hidden->SrcBufferDesc.uiYResolution * cx / pVideo->hidden->SrcBufferDesc.uiXResolution;
|
||||||
|
} else
|
||||||
|
if ((pVideo->hidden->ulResizingFlag & TF_TOP) || (pVideo->hidden->ulResizingFlag & TF_BOTTOM))
|
||||||
|
{
|
||||||
|
/* The window is resized vertically */
|
||||||
|
ncx = pVideo->hidden->SrcBufferDesc.uiXResolution * cy / pVideo->hidden->SrcBufferDesc.uiYResolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Calculate back frame coordinates */
|
||||||
|
rclTemp.xLeft = pswpTemp->x;
|
||||||
|
rclTemp.xRight = pswpTemp->x + ncx;
|
||||||
|
rclTemp.yBottom = pswpTemp->y;
|
||||||
|
rclTemp.yTop = pswpTemp->y + ncy;
|
||||||
|
WinCalcFrameRect(hwnd, &rclTemp, FALSE);
|
||||||
|
|
||||||
|
/* Store new size/position info */
|
||||||
|
pswpTemp->cx = rclTemp.xRight - rclTemp.xLeft;
|
||||||
|
|
||||||
|
if (!(pVideo->hidden->ulResizingFlag & TF_TOP))
|
||||||
|
{
|
||||||
|
pswpTemp->y = pswpTemp->y + pswpTemp->cy - (rclTemp.yTop - rclTemp.yBottom);
|
||||||
|
pswpTemp->cy = rclTemp.yTop - rclTemp.yBottom;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
pswpTemp->cy = rclTemp.yTop - rclTemp.yBottom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result = (*pOldFrameProc)(hwnd, msg, mp1, mp2);
|
||||||
|
|
||||||
|
if ((pVideo->hidden->bProportionalResize) && (msg==WM_QUERYTRACKINFO))
|
||||||
|
{
|
||||||
|
ti = (PTRACKINFO) mp2;
|
||||||
|
|
||||||
|
/* Store the direction of resizing */
|
||||||
|
if ((ti->fs & TF_LEFT) || (ti->fs & TF_RIGHT) ||
|
||||||
|
(ti->fs & TF_TOP) || (ti->fs & TF_BOTTOM))
|
||||||
|
pVideo->hidden->ulResizingFlag = ti->fs;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// PMThreadFunc
|
// PMThreadFunc
|
||||||
|
@ -1037,7 +1186,7 @@ static void PMThreadFunc(void *pParm)
|
||||||
&(pVideo->hidden->SrcBufferDesc),
|
&(pVideo->hidden->SrcBufferDesc),
|
||||||
WndProc,
|
WndProc,
|
||||||
&(pVideo->hidden->hwndClient),
|
&(pVideo->hidden->hwndClient),
|
||||||
&(pVideo->hidden->hwndFrame));
|
&(pVideo->hidden->hwndFrame));
|
||||||
|
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
printf("[PMThreadFunc] : FSLib_CreateWindow() rc = %d\n", rc);
|
printf("[PMThreadFunc] : FSLib_CreateWindow() rc = %d\n", rc);
|
||||||
|
@ -1085,6 +1234,11 @@ static void PMThreadFunc(void *pParm)
|
||||||
(rectl.yTop-rectl.yBottom),
|
(rectl.yTop-rectl.yBottom),
|
||||||
SWP_SIZE | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE);
|
SWP_SIZE | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE);
|
||||||
|
|
||||||
|
// Subclass frame procedure and store old window proc address
|
||||||
|
pVideo->hidden->pfnOldFrameProc =
|
||||||
|
WinSubclassWindow(pVideo->hidden->hwndFrame, FrameWndProc);
|
||||||
|
WinSetWindowULong(pVideo->hidden->hwndFrame, QWL_USER, (ULONG) pVideo);
|
||||||
|
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
printf("[PMThreadFunc] : Entering message loop\n"); fflush(stdout);
|
printf("[PMThreadFunc] : Entering message loop\n"); fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1814,7 +1968,7 @@ int os2fslib_IconifyWindow(_THIS)
|
||||||
hmqerror = WinGetLastError(hab);
|
hmqerror = WinGetLastError(hab);
|
||||||
|
|
||||||
WinSetWindowPos(_this->hidden->hwndFrame, HWND_TOP,
|
WinSetWindowPos(_this->hidden->hwndFrame, HWND_TOP,
|
||||||
0, 0, 0, 0, SWP_MINIMIZE);
|
0, 0, 0, 0, SWP_MINIMIZE);
|
||||||
|
|
||||||
// Now destroy the message queue, if we've created it!
|
// Now destroy the message queue, if we've created it!
|
||||||
if (ERRORIDERROR(hmqerror)==0)
|
if (ERRORIDERROR(hmqerror)==0)
|
||||||
|
@ -2139,7 +2293,7 @@ static void os2fslib_VideoQuit(_THIS)
|
||||||
should take care of cleaning up the current mode.
|
should take care of cleaning up the current mode.
|
||||||
*/
|
*/
|
||||||
static SDL_Surface *os2fslib_SetVideoMode(_THIS, SDL_Surface *current,
|
static SDL_Surface *os2fslib_SetVideoMode(_THIS, SDL_Surface *current,
|
||||||
int width, int height, int bpp, Uint32 flags)
|
int width, int height, int bpp, Uint32 flags)
|
||||||
{
|
{
|
||||||
static int bFirstCall = 1;
|
static int bFirstCall = 1;
|
||||||
FSLib_VideoMode_p pModeInfo, pModeInfoFound;
|
FSLib_VideoMode_p pModeInfo, pModeInfoFound;
|
||||||
|
@ -2475,7 +2629,7 @@ static SDL_Rect **os2fslib_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flag
|
||||||
pRect->h = pFSMode->uiYResolution;
|
pRect->h = pFSMode->uiYResolution;
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
// printf("!!! Seems to be good!\n");
|
// printf("!!! Seems to be good!\n");
|
||||||
// printf("F: %dx%d\n", pRect->w, pRect->h);
|
// printf("F: %dx%d\n", pRect->w, pRect->h);
|
||||||
#endif
|
#endif
|
||||||
// And insert into list of pRects
|
// And insert into list of pRects
|
||||||
if (!(_this->hidden->pListModesResult))
|
if (!(_this->hidden->pListModesResult))
|
||||||
|
@ -2489,7 +2643,7 @@ static SDL_Rect **os2fslib_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flag
|
||||||
if (_this->hidden->pListModesResult)
|
if (_this->hidden->pListModesResult)
|
||||||
{
|
{
|
||||||
_this->hidden->pListModesResult[0] = pRect;
|
_this->hidden->pListModesResult[0] = pRect;
|
||||||
_this->hidden->pListModesResult[1] = NULL;
|
_this->hidden->pListModesResult[1] = NULL;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
SDL_free(pRect);
|
SDL_free(pRect);
|
||||||
|
@ -2601,6 +2755,83 @@ static int os2fslib_VideoInit(_THIS, SDL_PixelFormat *vformat)
|
||||||
_this->hidden->fInFocus = 0;
|
_this->hidden->fInFocus = 0;
|
||||||
_this->hidden->iSkipWMMOUSEMOVE = 0;
|
_this->hidden->iSkipWMMOUSEMOVE = 0;
|
||||||
_this->hidden->iMouseVisible = 1;
|
_this->hidden->iMouseVisible = 1;
|
||||||
|
|
||||||
|
if (getenv("SDL_USE_PROPORTIONAL_WINDOW"))
|
||||||
|
_this->hidden->bProportionalResize = 1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PPIB pib;
|
||||||
|
PTIB tib;
|
||||||
|
char *pchFileName, *pchTemp;
|
||||||
|
char achConfigFile[CCHMAXPATH];
|
||||||
|
FILE *hFile;
|
||||||
|
|
||||||
|
/* No environment variable to have proportional window.
|
||||||
|
* Ok, let's check if this executable is in config file!
|
||||||
|
*/
|
||||||
|
_this->hidden->bProportionalResize = 0;
|
||||||
|
|
||||||
|
DosGetInfoBlocks(&tib, &pib);
|
||||||
|
pchTemp = pchFileName = pib->pib_pchcmd;
|
||||||
|
while (*pchTemp)
|
||||||
|
{
|
||||||
|
if (*pchTemp=='\\')
|
||||||
|
pchFileName = pchTemp+1;
|
||||||
|
pchTemp++;
|
||||||
|
}
|
||||||
|
if (getenv("HOME"))
|
||||||
|
{
|
||||||
|
sprintf(achConfigFile, "%s\\.sdl.proportionals", getenv("HOME"));
|
||||||
|
hFile = fopen(achConfigFile, "rt");
|
||||||
|
if (!hFile)
|
||||||
|
{
|
||||||
|
/* Seems like the file cannot be opened or does not exist.
|
||||||
|
* Let's try to create it with defaults!
|
||||||
|
*/
|
||||||
|
hFile = fopen(achConfigFile, "wt");
|
||||||
|
if (hFile)
|
||||||
|
{
|
||||||
|
fprintf(hFile, "; This file is a config file of SDL/2, containing\n");
|
||||||
|
fprintf(hFile, "; the list of executables that must have proportional\n");
|
||||||
|
fprintf(hFile, "; windows.\n");
|
||||||
|
fprintf(hFile, ";\n");
|
||||||
|
fprintf(hFile, "; You can add executable filenames into this file,\n");
|
||||||
|
fprintf(hFile, "; one under the other. If SDL finds that a given\n");
|
||||||
|
fprintf(hFile, "; program is in this list, then that application\n");
|
||||||
|
fprintf(hFile, "; will have proportional windows, just like if\n");
|
||||||
|
fprintf(hFile, "; the SET SDL_USE_PROPORTIONAL_WINDOW env. variable\n");
|
||||||
|
fprintf(hFile, "; would have been set for that process.\n");
|
||||||
|
fprintf(hFile, ";\n");
|
||||||
|
fprintf(hFile, "\n");
|
||||||
|
fprintf(hFile, "dosbox.exe\n");
|
||||||
|
fclose(hFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
hFile = fopen(achConfigFile, "rt");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hFile)
|
||||||
|
{
|
||||||
|
while (fgets(achConfigFile, sizeof(achConfigFile), hFile))
|
||||||
|
{
|
||||||
|
/* Cut \n from end of string */
|
||||||
|
|
||||||
|
while (achConfigFile[strlen(achConfigFile)-1] == '\n')
|
||||||
|
achConfigFile[strlen(achConfigFile)-1] = 0;
|
||||||
|
|
||||||
|
/* Compare... */
|
||||||
|
if (stricmp(achConfigFile, pchFileName)==0)
|
||||||
|
{
|
||||||
|
/* Found it in config file! */
|
||||||
|
_this->hidden->bProportionalResize = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(hFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DosCreateMutexSem(NULL, &(_this->hidden->hmtxUseSrcBuffer), 0, FALSE);
|
DosCreateMutexSem(NULL, &(_this->hidden->hmtxUseSrcBuffer), 0, FALSE);
|
||||||
|
|
||||||
// Now create our window with a default size
|
// Now create our window with a default size
|
||||||
|
@ -2777,7 +3008,7 @@ static SDL_VideoDevice *os2fslib_CreateDevice(int devindex)
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoBootStrap OS2FSLib_bootstrap = {
|
VideoBootStrap OS2FSLib_bootstrap = {
|
||||||
"os2fslib", "OS/2 Video Output using FSLib",
|
"os2fslib", "OS/2 Video Output using FSLib",
|
||||||
os2fslib_Available, os2fslib_CreateDevice
|
os2fslib_Available, os2fslib_CreateDevice
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,15 @@ struct SDL_PrivateVideoData
|
||||||
int fInFocus; // True if we're in focus!
|
int fInFocus; // True if we're in focus!
|
||||||
int iSkipWMMOUSEMOVE; // Number of WM_MOUSEMOVE messages to skip!
|
int iSkipWMMOUSEMOVE; // Number of WM_MOUSEMOVE messages to skip!
|
||||||
int iMouseVisible; //
|
int iMouseVisible; //
|
||||||
|
|
||||||
|
PFNWP pfnOldFrameProc; // Old window frame procedure
|
||||||
|
int bProportionalResize; // 0: No proportional resizing
|
||||||
|
// 1: Do proportional resizing
|
||||||
|
ULONG ulResizingFlag; // First resizing flag value
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* OS/2 specific backdoor function to be able to set FrameControlFlags of */
|
||||||
|
/* the SDL window before creating it. */
|
||||||
extern DECLSPEC void SDLCALL SDL_OS2FSLIB_SetFCFToUse(ULONG ulFCF);
|
extern DECLSPEC void SDLCALL SDL_OS2FSLIB_SetFCFToUse(ULONG ulFCF);
|
||||||
|
|
||||||
#endif /* _SDL_os2fslib_h */
|
#endif /* _SDL_os2fslib_h */
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# This is a Watcom makefile to build SDL.DLL for OS/2
|
|
||||||
#
|
|
||||||
# Makefile for test applications
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
# Create debug build or not?
|
|
||||||
debug_build=defined
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
# The next part is somewhat general, for creation of EXE files.
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
cflags = $(debugflags) -bm -bt=OS2 -5 -fpi -sg -otexan -wx -ei
|
|
||||||
|
|
||||||
.before
|
|
||||||
set include=$(%os2tk)\h;$(%include);../include
|
|
||||||
|
|
||||||
.extensions:
|
|
||||||
.extensions: .exe .obj .c
|
|
||||||
|
|
||||||
all : testalpha.exe &
|
|
||||||
testbitmap.exe &
|
|
||||||
testcdrom.exe &
|
|
||||||
testcpuinfo.exe &
|
|
||||||
testjoystick.exe &
|
|
||||||
testkeys.exe &
|
|
||||||
testlock.exe &
|
|
||||||
testsem.exe &
|
|
||||||
testsprite.exe &
|
|
||||||
testtimer.exe &
|
|
||||||
testtypes.exe &
|
|
||||||
testver.exe &
|
|
||||||
testvidinfo.exe &
|
|
||||||
testwin.exe &
|
|
||||||
testwm.exe &
|
|
||||||
threadwin.exe &
|
|
||||||
torturethread.exe &
|
|
||||||
checkkeys.exe
|
|
||||||
|
|
||||||
.c.obj : .AUTODEPEND
|
|
||||||
wcc386 -zq -bm -5s -ei -oteaxan -wx $[* $(cflags)
|
|
||||||
|
|
||||||
.obj.exe : .AUTODEPEND
|
|
||||||
wlink system os2v2 F $* L ..\src\sdl.lib name $@ op quiet
|
|
||||||
|
|
||||||
clean : .SYMBOLIC
|
|
||||||
@if exist *.exe del *.exe
|
|
||||||
@if exist *.obj del *.obj
|
|
||||||
@if exist *.map del *.map
|
|
||||||
@if exist *.res del *.res
|
|
||||||
@if exist *.lst del *.lst
|
|
Loading…
Add table
Add a link
Reference in a new issue