WebSite Information > Article Discussions
Games with older SDL and FSLIB
Dave Yeo:
Curious if they would work with GCC/LIBC as they're compiled with OpenWatcom. So did a quick hack to test. The original rockdodger failed to compile with an incomplete struct error and a lot of warnings, so I tested the newer one I referenced. It is a quick hack so the only changes I made to rockdodger was,
--- Code: ------ Makefile.orig 2025-06-23 21:18:06.000000000 -0700
+++ Makefile 2025-06-23 21:25:26.000000000 -0700
@@ -41,13 +41,13 @@
NEWD=$(PACKAGENAME)-$(VERSION)
COMPILEDATE=$(shell date --date=@$${SOURCE_DATE_EPOCH:-$$(date +%s)} '+%Y-%m-%d')
TARPKGNAME=$(NEWD).pkg.tgz
-OPTIONS=-DVERSION=\"$(VERSION)\" -DCOMPILEDATE=\"$(COMPILEDATE)\" -Wall `$(SDL_CONFIG) --cflags`
-EXENAME=rockdodger
+OPTIONS=-DVERSION=\"$(VERSION)\" -DCOMPILEDATE=\"$(COMPILEDATE)\" -Wall -I../SDL/h
+EXENAME=rockdodger.exe
SOUNDLIBRARIES=-lSDL_mixer
SDL_CONFIG=sdl-config
-LIBRARIES=`$(SDL_CONFIG) --libs` -lSDL_image $(SOUNDLIBRARIES) -lm
+LIBRARIES=-L../SDL/lib -lSDL_image -lsdl12 $(SOUNDLIBRARIES) -lm
OBJECTS=SFont.o guru_meditation.o signal_handling.o random_gen.o datafun.o sound.o input_functions.o scroller.o display_subsystem.o \
game_state.o highscore_io.o sprite.o \
blubats.o greeblies.o powerup.o rocks.o spacedots.o ship.o engine_exhaust.o laser.o \
@@ -78,7 +78,7 @@
ifeq ($(profile),1)
$(CC) -pg -o $(EXENAME) $(OBJECTS) $(LIBRARIES)
else
- $(CC) $(LDFLAGS) -o $(EXENAME) $(OBJECTS) $(LIBRARIES)
+ $(CC) $(LDFLAGS) -Zomf -o $(EXENAME) $(OBJECTS) $(LIBRARIES)
endif
clean:
--- End code ---
More work should be done on it, including install, uninstall and pkg.
Actually some of my changes can be reverted if Andrey's SDL package is adapted for GCC. Need sdl-config and renaming the lib names. eg sdlimage.lib --> SDL_image.lib. sdl-config would take care of setting -I and -L so the includes and libs can be found.
Anyways, here's the result, only tested to see if it runs and it needed sdl.ini, included in the package. Please test.
Dave Yeo:
Here's sdl-config, I put in h:\tmp\SDL\bin and did "set PATH=h:\tmp\SDL\bin;%PATH%
You need to adjust the prefix to reflect where you installed Valerie's SDL package, rename some of the libs as mentioned, and I had to patch h/SDL/SDL_config_os2.h like so,
--- Code: ---H:\tmp\SDL\h\SDL>diff -u SDL_config_os2.h.orig SDL_config_os2.h
--- SDL_config_os2.h.orig 2025-06-23 22:24:50.000000000 -0700
+++ SDL_config_os2.h 2025-06-23 22:17:58.000000000 -0700
@@ -34,7 +34,9 @@
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
+#if !defined (__EMX__)
typedef unsigned long uintptr_t;
+#endif
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
--- End code ---
Perhaps all the typedef's should be wrapped in the #if defined (__EMX__).
With these changes to the SDL package, rockdodger compiles fine with the original makefile. Changes could still be made, EXENAME=rockdodger.exe so make clean cleans it and trying make pkg failed looking for /usr/bin/install, should be /@unixroot/usr/bin/install, like similar changes can be made.
Many a SDL game should compile for you with these.
sdl-config
--- Code: ---#!/bin/sh
# Edit the prefix below to reflect your environment
prefix=h:/tmp/SDL
exec_prefix=$prefix
exec_prefix_set=no
libdir=$prefix/lib
usage="\
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
#usage="\
#Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo 1.2.15
;;
--cflags)
echo -I$prefix/h
;;
--libs)
echo -L$prefix/lib -Zomf -lsdl12
;;
# --static-libs)
## --libs|--static-libs)
# echo -L/@unixroot/usr/lib -lSDL -lm
# ;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
--- End code ---
Dave Yeo:
So tried Abes Amazing Adventure, https://github.com/OSSGames/AbesAmazingAdventure.
It uses configure so need to run "sh autogen.sh". Configure failed looking for SDL.h, patched the macro to look for SDL/SDL.h (source will need the same), reran autogen.sh and it dies here,
--- Code: ---checking for sdl-config... h:/tmp/sdl/bin/sdl-config
checking for SDL - version >= 1.0.1... yes
checking for SDL_JoystickOpen... no
*** This version of SDL doesn't have joystick support.
*** Configuring without joystick support.
checking for Mix_OpenAudio in -lSDL_mixer... no
*** SDL_mixer not found. Configuring without audio support.
--- End code ---
I don't think any SDL1 has joystick support and the SDL_mixer error is,
--- Code: ---configure:7448: checking for Mix_OpenAudio in -lSDL_mixer
configure:7477: eval gcc -o conftest.exe conftest.c -lSDL_mixer -ldl -lm -Lh:/tmp/SDL/lib -Zomf -lsdl12 &5
Error! E2028: _Mix_OpenAudio is an undefined reference
--- End code ---
Of course the OW build has Mix_OpenAudio as a symbol, wrong calling convention.
Martin Iturbide:
Thanks a lot Dave.
Let me know if it is fine how I packed Rock Dodger.
I hope I uploaded the source code correctly on Github:
- https://github.com/OS2World/GAME-SDL-ACTION-RocksnDiamonds
Regards
Update: Corrected version on the file.
Martin Iturbide:
Hello Dave
Please, if you got the time check also Alizarin Tetris.
- https://github.com/OSSGames/GAME-SDL-PUZZLE-Alizarin_Tetris
Regards
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version