Author Topic: Games with older SDL and FSLIB  (Read 1565 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5347
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Games with older SDL and FSLIB
« on: June 23, 2025, 05:08:53 pm »
Hello Again

I've been updating my OHFOWG project and I found some SDL games that does not work directly on ArcaOS.

They use an old SDL.DLL library (that is SDL 1.x) and some require "SDDHELP$".

Code: [Select]
Games that require SDL.DLL

G:\WARP\A\Abe's Amazing Adventure
G:\WARP\A\Alizarin Tetris
G:\WARP\E\Enigma
G:\WARP\F\Formido
G:\WARP\H\UHexen
G:\WARP\K\KoboDeluxe
G:\WARP\L\Lopan
G:\WARP\L\Luola
G:\WARP\M\Marryampic2
G:\WARP\R\Rock Dodger
G:\WARP\S\sdlinvaders
G:\WARP\S\sdlroids
G:\WARP\S\sdlzombies
G:\WARP\S\snakeme
G:\WARP\S\still yet another sokoban
G:\WARP\T\Tiles World
G:\WARP\X\XRick

Code: [Select]
Games that Requires FSLIB.DLL

G:\WARP\A\Abe's Amazing Adventure
G:\WARP\A\Alizarin Tetris
G:\WARP\A\Amoebax
G:\WARP\C\Cuyo\bin
G:\WARP\E\Enigma
G:\WARP\F\Formido
G:\WARP\H\UHexen
G:\WARP\I\InfinityCat
G:\WARP\K\KoboDeluxe
G:\WARP\K\Kuklomenos
G:\WARP\L\Lopan
G:\WARP\L\Luola
G:\WARP\M\Marryampic2
G:\WARP\P\Pingus
G:\WARP\R\Rock Dodger
G:\WARP\S\sdlinvaders
G:\WARP\S\sdlroids
G:\WARP\S\sdlzombies
G:\WARP\S\snakeme
G:\WARP\S\still yet another sokoban
G:\WARP\T\Tiles World
G:\WARP\X\XRick

But FSLIB.DLL also shows in some of the games. For what I know FSLIB is a library to allow the game to run in Full Screen, it also says that "SDDHELP$" is required.

My questions are:
1) Does it makes sense today to use FSLIB, or if there is a better alternative with SDL? I had seen games that with Alt+Tab I can get full screen in games like Tower Toppler without using FSLIB.

2) Does it makes sense to try to recompile this games to avoid FSLIB and "SDDHELP$", or it can backfire?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Pete

  • Hero Member
  • *****
  • Posts: 1416
  • Karma: +15/-0
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #1 on: June 23, 2025, 11:49:19 pm »
Hi Martin

If you can recompile any of the games without the need for SDDHELP$ it would make those games playable on systems using panorama driver. I suspect it would need a lot of work though...


Regards

Pete

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #2 on: June 24, 2025, 02:55:39 am »
In theory, recompiling should be easy. In practice, I randomly chose rockdodger. The compile died at,
Code: [Select]
H:\tmp\rockdodger>make
cc -c -g sound.c `sdl-config --cflags` -DVERSION=\"0.6\" -DCOMPILEDATE=\"28/7/02
\"
sound.c:5:10: fatal error: SDL/SDL_mixer.h: No such file or directory
    5 | #include <SDL/SDL_mixer.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make.exe: *** [Makefile:35: sound.o] Error 1

We don't have an RPM SDL_mixer and rockdodger uses mods for music.
I can build SDL_mixer, possible dependencies include, timidity for midi support, mikmod for mod support, smpeg or libmad-gpl for MP3 support, as well as flac and ogg which we have RPM's. Actually we also have libmikmod.
Seems there are SDL_mixer ports already floating around as well the other dependencies which can lead to DLL hell.
I also saw a SDL2 port, the repository was gone.
« Last Edit: June 24, 2025, 02:57:47 am by Dave Yeo »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #3 on: June 24, 2025, 03:21:04 am »
Found a newer rockdodger, its build dies due to no SDL-image. Readme also says SDL_mixer is a requirement.
https://bitbucket.org/rpkrawczyk/rockdodger/src/master/

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5347
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #4 on: June 24, 2025, 04:57:12 am »
Thanks for the feedback and for giving it a try.

We don't have an RPM SDL_mixer and rockdodger uses mods for music.

I guess we need to use Andrey Vasilkin SDL 1 port for the missing SDL libs.
- https://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/dev/libraries/graphics/SDL_1-2-15_2020-10-05.zip

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #5 on: June 24, 2025, 06:46:02 am »
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: [Select]
--- 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:

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

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #6 on: June 24, 2025, 07:31:08 am »
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: [Select]
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;

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: [Select]
#!/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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #7 on: June 24, 2025, 05:58:31 pm »
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: [Select]
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.

I don't think any SDL1 has joystick support and the SDL_mixer error is,
Code: [Select]
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

Of course the OW build has Mix_OpenAudio as a symbol, wrong calling convention.


Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5347
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #8 on: June 25, 2025, 03:24:06 am »
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.
« Last Edit: June 25, 2025, 03:41:26 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5347
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #9 on: June 25, 2025, 03:45:39 am »
Hello Dave

Please, if you got the time check also Alizarin Tetris.
- https://github.com/OSSGames/GAME-SDL-PUZZLE-Alizarin_Tetris

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #10 on: June 25, 2025, 04:34:10 am »
Thanks a lot Dave.

Let me know if it is fine how I packed Rock Dodger.

I had the sdl DLLs in the source for testing, they should be removed and also do a make clean to shrink the size.
Edit: Otherwise fine

Quote
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.

It is rockdodger, not RocksnDiamonds which is a completely different game.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5347
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #11 on: June 25, 2025, 04:44:16 am »
It is rockdodger, not RocksnDiamonds which is a completely different game.
Oops... I think I'm falling sleep.

It is fixed now: https://github.com/OS2World/GAME-SDL-ACTION-RockDodger

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #12 on: June 25, 2025, 04:45:59 am »
Hello Dave

Please, if you got the time check also Alizarin Tetris.
- https://github.com/OSSGames/GAME-SDL-PUZZLE-Alizarin_Tetris

Regards

Seems to be missing some pieces,
Code: [Select]
config.status: error: cannot find input file: '.protos/Makefile.in'

Edit:
Removing the reference from configure.in results in,
Code: [Select]
Makefile.am:50: error: required directory ./.protos does not exist
make: *** [Makefile:120: Makefile.in] Error 1
« Last Edit: June 25, 2025, 04:49:16 am by Dave Yeo »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5441
  • Karma: +129/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #13 on: June 25, 2025, 05:44:37 am »
Found the missing files. Built fine, keys seem jerky, perhaps needs sdl.ini.
I committed some changes including the missing .protos/

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5347
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #14 on: June 25, 2025, 06:08:34 pm »
Thanks Dave

I found some missing files like sounds from the old compile binaries.

In my case it runs too fast when selecting the menus and even the fire shows too fast, but the game is playable.

I added your source code here:
- https://github.com/OS2World/GAME-SDL-PUZZLE-Alizarin_Tetris

I'm attaching the binary release for the public.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.