The Adlan Adventure Game Compiler

Richard Brooksby, 1999-09-20

I used to develop software for the Amstrad CPC back in the mid-80s when I was a teenager. My largest and most successful project was the "Adlan" adventure game compiler ROM, which was published by Graduate Software, and reviewed in at least one magazine.

I wrote Adlan before I went to University and got to really understand how conventional compilers worked. It just reads tokens and emits Z80 machine code straight away, which made it fast, at least. It also means that the language is entirely in prefix notation -- there's no infix expression parser. That didn't matter much because you don't tend to do much arithmetic in an adventure game.

Adlan was a pretty cool project. It's all in Z80 assembler, compiled with the Arnor MAXAM assembler ROM. It's divided into files because it wouldn't all fit in memory.

The source code is for the ROM version. I think it can still generate a RAM version (which could be run from disk) with a bit of work.

adlan.max
The master file. This was kept small so the program could be assembled into RAM for debugging.
adlan1.sub
Most of the compiler is here, starting right at the beginning of the file. Each main section of the source code is processed in turn. Subroutines for compiling things like strings (comp_str), word lists (comp_words), code statements (comp_code), and expressions comp_exp) follows.
adlan2.sub
This short file contains a few more subroutines for compiling things like colour names (comp_colour) and then has tables of all the compiler error messages and keywords.
adlan3.sub
This is the run-time code for the adventure. It has the run-time implementations of things like the parser, formatted text output, the various language commands, loading and saving games, and so on.
adlan4.sub
This contains a the utility commands that came on the ROM: COMPRESS, ROMOFF, etc. It has the picture compression routine used to create the ".csc" files, which works by storing the differences between lines on the screen. It also contains the help text, and the fonts. The fonts were created using another program I wrote called "Charon".
adlan.rom
Finally, here's the ROM image, suitable for use in emulators, or for blowing on to an EPROM. I rebuilt this recently using an emulator so that I could add copyright messages allowing distribution of the ROM. You can read the messages in the copying routine in the adlan4.sub file.

There was a large user manual written using the Arnor PROTEXT word processor ROM. It was originally printed on an Epson dot matrix printer. I've converted the whole thing into HTML, but preserved pretty much all the original text as it was. There were a bunch of template source files distributed with Adlan, which are also here.

User Manual
The user's manual, converted to HTML.
frame.adl
ASCII file containing framework
frame.bdl
BASIC quoted file containing framework
wframe.adl
ASCII framework using windows and colours in mode 1
wframe.bdl
BASIC quoted framework using windows and colours in mode 1
example.adl
ASCII file containing the example adventure used in the User Manual

I was a pretty poor speller. The "unical" font should really have been "uncial". It was based on calligraphy example I found with an Osmiroid fountain pen.

Last but by no means least, my school friend and I spent a long time putting together an adventure game called "Bar Trek", a Star Trek spoof adventure. It was a lot of fun to do, and I still found it funny to play even after 13 years, probably because I still have a childish sense of humour. Writing Bar Trek was the real test case for Adlan, and was the reason why most of the features were developed. Here's the opening screen for Bar Trek, which kind of sets the tone for the rest of the game:

(screen shot of the Bar Trek opening screen)

I drew this picture using my own Picgen program (another project) which I'll put on the web when I retreive it. I also discovered a pencil-drawn map of the game.

supplied.dsk
The disk that was supplied with the Adlan ROM. It contains the runnable Bar Trek adventure, plus all the framework files above and some programs to help with compressing screens. It's in the EDSK format used by most of the Amstrad CPC emulators. (I'm using CPC++.) You might need to right-click or click-and-hold on this and use "Save" or "Download" to make your browser do the right thing.

It's interesting to read what I thought about software when I was just 17:

The ADLAN compiler was designed, not as an adventure creating package, but as an adventure language. It is intended to be as flexible and open-ended as possible, and not to restrict the user to a fixed type or format of adventure. ADLAN was written in response to other packages which did exactly that. As a result, the presentation of an adventure written using ADLAN requires a little more thought from the user. However, with proper use of windows, control codes, character sets and graphics I believe the result will be of higher quality.

Any future versions of ADLAN-I will be upwardly compatable with this version.

There is no commission to pay if you want to market adventures written with ADLAN, after all, that is what a compiler is for! However, a mention of ADLAN on your title screen would be appreciated.

I hope you enjoy using ADLAN, and good luck.

(screen capture of Adlan ROM sign-on banner)

Many thanks to Martyn Lycett for retrieving the contents of my old three inch Amstrad diskettes so that I could put this information together.


Copyright © 1999-2000 Richard Brooksby. You may make and distribute verbatim copies of this document provided that you retain as they appear all copyright and licence notices. You may not charge a fee for this document or for distributing this document. You may not make or distribute derivative works (modified versions) of this document without the express written permission of the copyright holder.