News:

OS2World.com Forum is back !!!

Remember to visit OS2World at:
http://www.os2world.com

Main Menu

Games with older SDL and FSLIB

Started by Martin Iturbide, June 23, 2025, 05:08:53 PM

Previous topic - Next topic

Martin Iturbide

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$".


Games that require SDL.DLL

* Issues -G:\WARP\A\Abe's Amazing Adventure - Issue Mix_OpenAudio
* Done - G:\WARP\A\Alizarin Tetris
* Done - G:\WARP\E\Enigma - Issues with Imagemagick. (Paul's Port was already good)
* Done - G:\WARP\F\Formido
* Done - G:\WARP\H\UHexen (replaced with UHexen/2)
* Issues -G:\WARP\K\KoboDeluxe - Issue with cmake finding SDL_image
* Done -G:\WARP\L\Lopan
* Done -G:\WARP\L\Luola
* Done - G:\WARP\M\Marryampic2
* Done - G:\WARP\R\Rock Dodger
* Done - G:\WARP\S\sdlinvaders
* Done - G:\WARP\S\sdlroids
* Done -G:\WARP\S\sdlzombies
* Issues - G:\WARP\S\snakeme - issue with cmake
* Done - G:\WARP\S\still yet another sokoban
* Done - G:\WARP\T\Tile World
* Done - G:\WARP\X\XRick



Games that Requires FSLIB.DLL

* Issues -G:\WARP\A\Abe's Amazing Adventure - Issue Mix_OpenAudio
* Done - G:\WARP\A\Alizarin Tetris
* Issues - G:\WARP\A\Amoebax -  Requires source patching
* Done - G:\WARP\C\Cuyo\bin
* Done - G:\WARP\E\Enigma - Issues with Imagemagick. (Paul's Port was already good)
* Done - G:\WARP\F\Formido
* Done - G:\WARP\H\UHexen (replaced with UHexen/2)
G:\WARP\I\InfinityCat
* Issue - G:\WARP\K\KoboDeluxe - Issue with cmake finding SDL_image
* Isssue -. G:\WARP\K\Kuklomenos - Requires tremor playback codec
* Done -G:\WARP\L\Lopan
* Done -G:\WARP\L\Luola
* Done - G:\WARP\M\Marryampic2
* Issue - G:\WARP\P\Pingus - Dependency on OpenGL, older on Boost.
* Done - G:\WARP\R\Rock Dodger
* Done - G:\WARP\S\sdlinvaders
* Done - G:\WARP\S\sdlroids
* Done - G:\WARP\S\sdlzombies
* Issues - G:\WARP\S\snakeme - Issues with cmake
* Done - G:\WARP\S\still yet another sokoban
* Done - G:\WARP\T\Tiles World
* Done - 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

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

#2
In theory, recompiling should be easy. In practice, I randomly chose rockdodger. The compile died at,

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.

Dave Yeo

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

Thanks for the feedback and for giving it a try.

Quote from: Dave Yeo on June 24, 2025, 02:55:39 AM
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

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,

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

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,

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

#!/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

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,

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,

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

#8
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
OS2World NewsMaster
... just share the dream.

Martin Iturbide

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

Quote from: Martin Iturbide 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 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

Quote from: Dave Yeo on June 25, 2025, 04:34:10 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

#12
Quote from: Martin Iturbide 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

Seems to be missing some pieces,

config.status: error: cannot find input file: '.protos/Makefile.in'


Edit:
Removing the reference from configure.in results in,

Makefile.am:50: error: required directory ./.protos does not exist
make: *** [Makefile:120: Makefile.in] Error 1


Dave Yeo

Found the missing files. Built fine, keys seem jerky, perhaps needs sdl.ini.
I committed some changes including the missing .protos/

Martin Iturbide

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.