CSB running on current Mac OSX 10.14

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
makeplayhappy
Neophyte
Posts: 2
Joined: Thu May 07, 2020 11:56 am

CSB running on current Mac OSX 10.14

Post by makeplayhappy »

I wanted to play Dungeon Master again and I only have access to a modern (Intel) Mac, so I spent a bit of yesterday trying to get my head around the various options, emulators etc and found CSBWin which had the source code and some mention that it should compile under linux.

Unfortunately for me it was also written to compile under old Macs with different byte orders and (QuickDraw) graphics libraries.
I hacked around a couple of the build scripts and managed to get it working this morning. I thought I'd post the results here incase anyone wanted to play or build it on their Mac.

Here's a link to the built files:

https://drive.google.com/file/d/1n5mrBP ... sp=sharing

I'll put my hacked about version on github and link to it here next week sometime.

I'm not that technical (I've never written C or C++) but sort of understand build processes enough to hack this together to get it to work - here's a description of what I did;


==== How to Build on Mac OS X 10.14

The "Mac" part of the build / source code expects you to be running an old (OS9 ) Power PC Mac.
OSX Mac is unix so I tried to make the build script believe we're in a linux environment.

The main part is to "break out" of the Mac code which relies on a make / compiler environment definition of "TARGET_OS_MAC"

This is what I did to build the binaries contained in this package.

I cloned the tachyon branch of
https://github.com/hackerb9/tachyon

Code: Select all

> git clone -b tachyon https://github.com/hackerb9/tachyon
I have Apple build tools and XCode already installed and I use homebrew (https://brew.sh/) to install the necessary packages to allow CSBWin to compile.

Code: Select all

brew install automake
brew install sdl2
brew install sdl sdl_image sdl_mixer sdl_ttf
brew install libquicktime
brew install pkg-config
Then I modified

CSBTypes.h and makefile

CSBTypes.h ===== comment out the mac stuff and undefine the TARGET_OS_MAC around line 6

#ifdef TARGET_OS_MAC
// #if __MWERKS__
// #pragma reverse_bitfields on
// #else
// #error All bitfields must be reversed in order to run!
// #endif
//#define _bigEndian
// File structures that are saved in little-endian
// format must be converted to big-endian on the macintosh.
#undef TARGET_OS_MAC
#endif


makefile ==== add in some flags so the compiler knows where to find the libraries installed by homebrew


sdlversion = sdl2
CXXFLAGS += `pkg-config --cflags glib-2.0 $(sdlversion)`
LDFLAGS += `pkg-config --libs glib-2.0 $(sdlversion)`
CXXFLAGS += '-I/usr/local/include/SDL2'
CXXFLAGS += '-I/usr/local/include/glib-2.0'
CXXFLAGS += '-I/usr/local/Cellar/glib/2.64.0/lib/glib-2.0/include'
CXXFLAGS += -D_LINUX -D RGB655


then at the command line go into the folder and

Code: Select all

> make
then I copied in the .dat and key controll config files

run dungeon master using this from the command line

Code: Select all

> ./tachyon --large
you can rename the binary to whatever you like
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”