• DOSBox - DOS emulator which we will use to compile the game inside.

  • 4DOS - Command line interpreter, which supports the copy command with binary inputs and output.

  • Watcom 10 compiler - For compiling C sources and running MAKEFILEs

  • MASM (Microsoft Macro Assembler) 6.0 - For compiling ASM sources

Getting prerequisites and sources

DOSBox and 4DOS are freely available. For getting Watcom 10 and MASM 6.0, you need to search the internet. Note that we did not manage to build the game with Open Watcom. Also, for some reason the MASM version 6.11 compiler did run very slowly in the DOSBox, so it was basically unusable. We had to use the version 6.0.

All directories and files will placed in the ~/lba-hacking directory on the host machine. Feel free to change this path, but then adjust the DOSBox configuration below correspondingly. This directory will be mounted to C: in DOSBox.

The dir structure at this point should like something like this:

├── 4dos
├── install
│   ├── masm
│   └── watcom
└── lba

DOSBox configuration

Change the autoexec section of you DOSBox configuration like below. The configuration path of DOSBox is usually shown when you start it.

mount C ~/lba-hacking

PATH c:\watcom\binw;c:\masm\bin;%PATH%
set INCLUDE=c:\watcom\h;c:\lba\lib386
set WATCOM=c:\watcom
set EDPATH=c:\watcom\eddat
set WIPFC=c:\watcom\wipfc


Install tools

  • Launch DOSBox (e.g. with dosbox).

  • On the first run, 4DOS will prompt some configuration values.

  • Install Watcom by running C:\INSTALL\WATCOM\SETUP.EXE and following the instructions. Leave the default installation path C:\WATCOM. The step which proposes to modify AUTOEXEC.EXE and CONFIG.SYS can be skipped.

  • Install MASM by running C:\INSTALL\MASM\DISK1\SETUP.EXE. Leave the default installation paths C:\MASM\BINB, etc…

Check the installation by typing in:

  • wmake: this should show the installed Watcom make version; in my case 10.5

  • wcc386: this should show the help of the Watcom C compiler; in my case 10.5

  • ml: this should show the version of the Microsoft Macro Assembler; in my case 6.00

Now we are ready to build the game.


Run inside the DOSBox

cd C:\LBA\LIB386

cd LIB_3D

cd ..\LIB_MENU

cd ..\LIB_MIDI

cd ..\LIB_MIX

cd ..\LIB_SAMP

cd ..\LIB_SVGA

cd ..\LIB_SYS

cd ..\..\SOURCES

The last command will link the LBA0.exe.


To run the game, you will need some assets of the original game.

  • copy HQR files,

  • copy M_SB16.DLL, S3.DLL, and W_SB16.DLL,

  • copy LBA.CFG,

into the directory containing LBA0.exe, in our case C:\LBA\SOURCES.


dos4gw LBA0.exe