Author Topic: Request: Compile "Tower Topper" (aka Nebulus)  (Read 1311 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Request: Compile "Tower Topper" (aka Nebulus)
« on: May 11, 2025, 10:20:22 pm »
Hello

Can someone please help me to compile "Tower Topper" 1.3 to AcaOS ?
It uses SDL 2 now. (Dependencies: SDL2_mixer  (with ogg support if you want music), sdl2 and zlib)

Here it is the source code: https://gitlab.com/roever/toppler/

Here it is the old one, just in case: https://www.os2world.com/games/index.php/native-games/strategy/301-tower-toppler

I will like to understand better the makefile to see if I can do it by myself as an exercise.

Regards
« Last Edit: May 11, 2025, 10:22:40 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #1 on: May 12, 2025, 12:37:14 am »
Seems to have a dependency on gimp.
Here's the diff to build the executable,
Code: [Select]
diff --git a/Makefile b/Makefile
index a6a140f..57fd6e6 100644
--- a/Makefile
+++ b/Makefile
@@ -18,10 +18,10 @@
 # along with this program; if not, write to the Free Software
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
 
-PREFIX = /usr
+PREFIX = /@unixroot/usr/local
 BINDIR = $(PREFIX)/bin
 DATADIR = $(PREFIX)/share
-STATEDIR = /var/toppler
+STATEDIR = /@unixroot/var/toppler
 LOCALEDIR = $(DATADIR)/locale
 MANDIR =  $(DATADIR)/man
 PKGDATADIR = $(DATADIR)/toppler
@@ -32,9 +32,10 @@ CONVERT = convert
 CXX = $(CROSS)$(CXX_NATIVE)
 CXX_NATIVE = g++
 CXXFLAGS = -Wall -Wextra -g -O2 -std=c++17
-EXEEXT = $(if $(filter %-w64-mingw32.static-,$(CROSS)),.exe,)
+# EXEEXT = $(if $(filter %-w64-mingw32.static-,$(CROSS)),.exe,)
+EXEEXT = .exe
 INSTALL = install
-LDFLAGS =
+LDFLAGS = -Zomf -Zhigh-mem -lintl
 MSGFMT = msgfmt
 MSGMERGE = msgmerge
 PKG_CONFIG = $(CROSS)$(PKG_CONFIG_NATIVE)

Which crashes without being installed with the data I think,
Code: [Select]
H:\tmp\toppler>toppler.exe

Killed by SIGSEGV
pid=0x01a8 ppid=0x0065 tid=0x0001 slot=0x00d3 pri=0x0200 mc=0x0001 ps=0x0010
H:\TMP\TOPPLER\TOPPLER.EXE
TOPPLER 2:000fff20
cs:eip=0000:0018ff20      ss:esp=0000:fffefdfc      ebp=00100053
 ds=6f6cd5d4      es=0000      fs=d3d2d1d0      gs=0000     efl=fbfaf9f8
eax=0018fd78 ebx=1ffc9d7c ecx=0018fd8c edx=0018fdb0 edi=656c6163 esi=0018ff8c
Creating 01A8_01.TRP
Moved 01a8_01.TRP to W:\var\log\app\6820c3a0-01a8_01-TOPPLER-exceptq.txt

Have to think on the data problem

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #2 on: May 12, 2025, 12:44:03 am »
You can probably download the data, perhaps from a release and manually install. It does want gimp and povray?

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #3 on: May 12, 2025, 02:36:04 pm »
Thanks Dave for helping out.

I'm looking for the compiled data (since it uses gimp) and see if it can run. Can you share your compiled binaries?

Checking:
- https://gitlab.com/roever/toppler/uploads/06111021dffe64f3bd5f5a22c87e9426/toppler-windows-1.3-r2.zip
Will it be "toppler.dat" or the data files are being integrated with the .exe?

Regards
« Last Edit: May 12, 2025, 02:39:12 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #4 on: May 12, 2025, 04:53:04 pm »
OK, I seem to have misunderstood how it works. Have to look closer. Here's my binary.
« Last Edit: May 13, 2025, 12:36:55 am by Dave Yeo »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #5 on: May 12, 2025, 10:04:20 pm »
Thanks Dave.

Just a question here. I checked the Toppler.exe with pmdll.exe and it reference "SDL2MIX0.dll".
Is that correct? because our SDL2Mixer is called "SDL2M200.dll" as far as I know.

Quote
[C:\HOME\MARTIN\DOWNLOADS\TOPPLER]toppler
SYS1804: The system cannot find the file SDL2MIX0.

If I grab our "SDL2M200.dll" and rename it to "SDL2MIX0.dll" I get:
Quote
[C:\HOME\MARTIN\DOWNLOADS\TOPPLER]toppler
SYS1059: The system cannot execute the specified program.


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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #6 on: May 13, 2025, 12:40:02 am »
Whoops, it found  the one in usr/local. I updated the zip above with the right sdl_mixer dll. Still crashes

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #7 on: May 13, 2025, 12:55:13 am »
OK, looked at the crash closer, seems to be crashing looking for the translations. Here is an updated makefile.diff,
Code: [Select]
diff --git a/Makefile b/Makefile
index a6a140f..8a65621 100644
--- a/Makefile
+++ b/Makefile
@@ -18,10 +18,10 @@
 # along with this program; if not, write to the Free Software
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
 
-PREFIX = /usr
+PREFIX = /@unixroot/usr/local
 BINDIR = $(PREFIX)/bin
 DATADIR = $(PREFIX)/share
-STATEDIR = /var/toppler
+STATEDIR = /@unixroot/var/toppler
 LOCALEDIR = $(DATADIR)/locale
 MANDIR =  $(DATADIR)/man
 PKGDATADIR = $(DATADIR)/toppler
@@ -32,9 +32,10 @@ CONVERT = convert
 CXX = $(CROSS)$(CXX_NATIVE)
 CXX_NATIVE = g++
 CXXFLAGS = -Wall -Wextra -g -O2 -std=c++17
-EXEEXT = $(if $(filter %-w64-mingw32.static-,$(CROSS)),.exe,)
+# EXEEXT = $(if $(filter %-w64-mingw32.static-,$(CROSS)),.exe,)
+EXEEXT = .exe
 INSTALL = install
-LDFLAGS =
+LDFLAGS = -Zomf -Zhigh-mem -lintl
 MSGFMT = msgfmt
 MSGMERGE = msgmerge
 PKG_CONFIG = $(CROSS)$(PKG_CONFIG_NATIVE)
@@ -68,7 +69,7 @@ PKG_LIBS_NATIVE = $$($(PKG_CONFIG_NATIVE) --libs $(PKGS_NATIVE))
 DEFS += -DVERSION='"$(VERSION)"'
 DEFS += -DTOP_DATADIR='"$(PKGDATADIR)"'
 DEFS += -DHISCOREDIR='"$(STATEDIR)"'
-DEFS += -DENABLE_NLS=1
+# DEFS += -DENABLE_NLS=1
 DEFS += -DLOCALEDIR='"$(LOCALEDIR)"'
 
 FILES_H := $(wildcard src/*.h)
@@ -487,7 +488,7 @@ toppler.dat: _build/tools/crearc $(DATFILES)
 .PHONY: clean
 clean:
  rm -rf _build
- rm toppler
+ rm toppler$(EXEEXT)
 
 
 .PHONY: distclean

And a working binary, only lightly tested.

David McKenna

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +32/-0
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #8 on: May 13, 2025, 01:08:00 am »
Dave,

  With this one I'm getting:

[C:\junk\dl\toppler]toppler
SYS1804: The system cannot find the file SDL2MIX0.

 I do have all the SDL2 files installed. BTW - which version of SDL2 are you using? I have 2.0.18.

Regards,

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #9 on: May 13, 2025, 01:20:45 am »
Hmm, have to do more cleanup. For now here's SDLmix0.dll. Seems I built version 2.6.0 at some point
Added toppler.dat and toppler.ogg to put in the same directory as toppler.exe
« Last Edit: May 13, 2025, 01:23:33 am by Dave Yeo »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #10 on: May 13, 2025, 04:17:06 am »
Thanks Dave.

It is working here. Music and fullscreen also works.

What do you think about this packaging to share it around?


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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #11 on: May 13, 2025, 04:57:22 am »
That was version 1.3 I compiled as you requested.
Here's the newest, also linked to the correct sdl mixer I hope :)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #12 on: May 13, 2025, 05:00:34 am »
Thanks Dave.

It is working here. Music and fullscreen also works.

What do you think about this packaging to share it around?


Regards

Sure either version. Might want to fork the repository, apply the attached patch (git am < 0001-OS-2-support.patch) and refer to the source in the package.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #13 on: May 13, 2025, 02:54:19 pm »
Hello Dave

I cloned the repo here: https://github.com/OS2World/GAME-SDL-STRATEGY-Toppler

The patch command gave me an error with the .patch file, so I updated it by hand. I hope it is allright.

Regards
« Last Edit: May 13, 2025, 03:32:12 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Request: Compile "Tower Topper" (aka Nebulus)
« Reply #14 on: May 13, 2025, 04:35:58 pm »
Thanks Dave

Here it is the full package again. I tested it and it works.
Now it looks better with the common SDL2 Mixer.
I updated the readme.os2 too.

Regards
« Last Edit: May 13, 2025, 04:37:31 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.