Source/Linux JJFFE information

On this page

Elsewhere on the site


Versions

A slightly modified binary of the Linux/Allegro version can be found on Proton's FFE page along with some advice on running it. Otherwise it can be compiled from the source.

The current source release includes the following files:

jjffewip.zip:

ffe.asm             -   Main assembler source
ffedat.asm          -   Main assembler data
ffebmp.asm          -   Missions, models and bitmaps data

ffeapi.h            -   Header for JJFFE API
ffecfg.h            -   Header for config code
ffecfg.c            -   Config code
ffemisc.c           -   Misc. C code
hmp.cpp             -   Hmp->mid conversion code

ffewin.cfg          -   Config file for DirectX versions
ffedos.cfg          -   Config file for DJGPP/HMI version
ffedosal.cfg        -   Config file for DJGPP/Allegro version
ffelnxal.cfg        -   Config file for Linux/Allegro version

jjffent4.dsp        -   MSVC project file for Win32/DirectX3 version
jjffewin.dsp        -   MSVC project file for Win32/DirectX5 version
jjffew32.dsw        -   MSVC workspace file for both projects
ffedos.mak          -   Makefile for DJGPP/HMI version
ffedal.mak          -   Makefile for DJGPP/Allegro version
ffelal.mak          -   Makefile for Linux/Allegro version

srctools/ffedis.cpp     -   Decompiler code
srctools/convdata.cpp   -   String<->hex data conversion code
srctools/bmpconv.cpp    -   BMP->data conversion code
srctools/funcloc.cpp    -   Mapfile reordering code
srctools/expbmp.cpp     -   Data->BMP conversion code
srctools/gmstruct.txt   -   Partial map of D8804 structure
srctools/plstate.txt    -   Various other structure maps
srctools/shuttle.txt    -   Some 3d model structure info
srctools/c*.txt         -   Various partially-decoded functions

dos/dosapi.c            -   Main DJGPP/HMI code
dos/dosdir.c            -   DJGPP directory code
dos/dosinp.asm          -   DJGPP/HMI low-level input code
dos/dostime.asm         -   DJGPP/HMI low-level timer code
dos/dosvid.asm          -   DJGPP/HMI low-level display code
dos/doshmi.asm          -   DJGPP/HMI low-level HMI (sound) code
dos/dossound.asm        -   DJGPP/HMI low-level sound interface code
dos/joytest.cpp         -   DOS joystick tester util code
dos/joycalib.cpp        -   DOS joystick calibrator util code
dos/maccmain.c          -   DOS mouse accelerator util code
dos/macc.asm            -   DOS mouse accelerator util low-level code

linux/linuxdir.c        -   Linux directory code
linux/lnxconv.c         -   Linux underscore conversion util code

alleg/allegsnd.c        -   Allegro sound code
alleg/allegapi.c        -   Other Allegro code

win32/win32api.h        -   DirectX internal header
win32/w32dir.cpp        -   Win32 directory code
win32/w32input.cpp      -   DirectX5 input code
win32/w32inpnt.cpp      -   DirectX3 input code
win32/w32time.cpp       -   Win32 timer code
win32/w32video.cpp      -   DirectX display code
win32/w32sound.cpp      -   DirectX sound code

sdl/sdlvideo.cpp        -   SDL display code
sdl/sdlsound.cpp        -   SDL sound code
sdl/sdlinput.cpp        -   SDL input code
sdl/sdltimer.cpp        -   SDL timer code

	

NASM and general source compilation issues

To compile any version you'll need an appropriate NASM 0.98 binary. Note that the real-mode DOS NASM binaries will not work because the assembler files are much too large. NASMW.EXE will work fine (under Windows) if renamed to NASM.EXE, or you can compile a DJGPP version from the NASM source.

Note that NASM 0.98.08 seems to have a bug that prevents compilation of JJFFE. Newer versions should be fine.

The warning: multi-character character constant in hmp.cpp is not a problem.

Compiling source versions under DJGPP

Apart from NASM, you'll need a version of Allegro to compile the DJGPP/Allegro version. JJFFE should compile with practically any DJGPP/GCC version, and is tested with Allegro 3.12. Newer versions of Allegro should work.

If DJGPP, Allegro (Not needed for HMI version) and NASM are installed correctly, compilation should simply require typing make -f ffedos.mak or make -f ffedosal.mak, depending on desired version.

Compiling source versions under MSVC

This is tested under MSVC 6 SP4. You may need to recreate the project files for MSVC 5. Once again you'll need NASM, and also the DirectX 6.1+ SDK and optionally SDL for the SDL version. Nothing else should be non-obvious.

It should be possible to compile JJFFE with free GCC-based Win32 compilers, provided that they can handle the DirectX headers.

Compiling source versions under Linux

Once again you'll need NASM, and depending which version you want to compile, either Allegro or SDL libraries and headers. These may have other dependencies - Xlib, SVGAlib, OpenGL etc, although the critical ones should be installed by default.

Once the libraries are installed correctly, you should be able to compile simply by typing make -f ffelnxal.mak for the Allegro version or make -f ffelnxsdl.mak for the SDL version. These use the allegro-config or sdl-config programs to generate libs and flags parameters, so these must be somewhere in the path.

Note that the Linux makefiles also generate and use a utility that removes the underscores from global/extern symbol names in the assembler files. Linux C compilers don't appear to add underscores to function names, unlike DOS/Win compilers.

Library links

NASM sourceforge page
SDL library page
Allegro library page


Running Linux binaries (general)

You'll need to sort out an FFE directory tree as described in the advanced installation section. Additionally, all FFE filenames must be lowercased - note that this wasn't entirely true for JJFFE 2.8 (cabin bitmaps were Cabin*.bmp, not cabin*.bmp), but it is fixed in the current version. With the 2.8 source, config files may also need conversion to Linux (rather than CR/LF) text file format.

Other than the Linux-compiled versions, you can try running the DJGPP versions under DOSEMU, or the DirectX versions under WINE. The latter apparently works very well in fullscreen, although WINE bugs/features screw up the mouse control in windowed modes.

Running Linux/Allegro binaries

You'll need to run allegro-config and possibly move the resulting allegro.cfg to the FFE directory to get most things working. Feel free to try any of the options in this file, but don't expect any of them to work. An example allegro.cfg file that works with mouse, sound and music support with SVGAlib on one machine is available here. Make sure that all the device paths are correct for your machine.

There are two ways of running Linux/Allegro JJFFE that are known to work. Running under X is the easiest, but you're restricted to a 320x200 window and it tends to be very slow, although faster since 2.7. There's also an additional config file option which should enable a 640x400 mode - try adding Scale=2.

Running with SVGAlib is harder, but gives an experience similar to DOS FFE. You'll need SVGAlib installed, plus GPM (or LIPS) for mouse support. The mouse tends to only work in a virtual console, and you'll need to run in root otherwise SVGAlib will segfault.

Running Linux/SDL binaries

The SDL version provides three different basic display output modes (OpenGL, direct soft-scaled SDL and overlay). You may need to change many of config file (ffelnxsdl.cfg) settings to attain optimal performance due to driver and hardware differences, particularly with OpenGL. These are documented in the config file.

Note that fullscreen modes below 640x480 are unlikely to be available unless you set them up specifically in the X configuration file, and SDL will default to the next highest available mode with the view window centered. Use of the SDL version outside X is untested.

The SDL version has sound but no music, as I couldn't find a portable non-software MIDI library. If you really want the FFE midis you can always playlist them in the background.


Return to main page