This project is related to my Defender Red Label project, which attempt to create a generated Defender clone from the ROM version generated in this repository.
The source
directory contains the Historical Source Defender source code. This includes the single sound file from the Historical Source Sound ROMS for Williams. The source\labels
directory contains the binaries for the different labels of the game that were produced.
The src
directory is the original source code with certain modifications to make it possible to compile that code on a relatively modern development chain.
In terms of the provenance of the code, ex-Williams engineers had previously donated material to the Strong Museum of Play. Some of that was the work of Sam Dickers on Defender.
You can use some ROM files to play Defender via MAME. On Windows you can install this via a binary. On most POSIX systems:
sudo apt install mame
On Mac:
brew install mame
However, to be able to do this you have to generate the ROM files. And to do that, you have to build from source, which is what the next section is about.
That said, I have provided what should be the outputs for you in the build
directory. These are the defend.[x]
files that will be generated by the toolchain in this repo. You will also have to reference the specific files in the mame
folder. If have MAME installed, the easiest way to do everything is:
- Create a directory in your
mame\roms
directory calleddefender
. - Copy the contents of this repo's
build
directory into the above directory. - Copy the contents of this repo's
mame
directory into the above directory.
That should allow you to play the "Defender (Red Label)" entry in MAME.
On Windows, I would highly recommend using Windows Subsystem for Linux. Cygwin or other POSIX-based implementations might work as well.
First, make sure you clone the repo:
git clone https://github.com/jeffnyman/retro-defender.git
You need to set up the Git submodules that provide the assembler toolchain.
git submodule init
git submodule update
The tools used here are ASM6809 and VASM.
There are some Python scripts used as part of the building process, so you should have a version of Python 3 installed. On Linux:
sudo apt install python3
On Mac:
brew install python3
You can use whateever installation method you want, of course. On Windows, you can install the a binary of your choice. In any environment, make sure Python is on your PATH.
There is a Makefile present to help run the various commands of the build toolchain. Technically, you could just run those commands individualy but having Make installed would not hurt. On a POSIX system you will have this already, most likely.
If on a Mac, you will need the following:
brew install md5sha1sum
brew install automake
On a Mac, you will likely have Bison but I recommend making sure it's up-to-date.
brew install bison
export PATH="/usr/local/opt/bison/bin:$PATH"
If on a Linux variant, make sure you have the following:
sudo apt install build-essential flex
From the root project directory, run the following commands:
cd asm6809
./autogen.sh
./configure
The autogen.sh
script generates the configure script (from configure.ac
, using autoconf) and any files it needs (like creating Makefile.in from Makefile.am using automake). This requires autotools to be installed on your system. The configure script generates Makefile
and other files needed to build.
If the above steps complete succesfully, you should be able to make everything. Still in the asm6809
directory, run the following:
make
From the root project directory, run the following commands:
cd vasm
make CPU=6800 SYNTAX=oldstyle
With both ASM and VASM built, you should be able to build the binaries for Defender. This will require access to Python as it will use the included scripts in this repo.
From the root project directory, run the following command:
make redlabel
This will create the defend.[x]
numbered binaries (excluding 5) as well as the defend.snd
file. These should be the same files that you see in the build
directory.
An executable Defender version is provided in the reference
directory. This was the basis for determining the correct implementation of building from the sources. Technically there is no reason you need to worry about this, but should you want to generate the reference implementation ROM, you can first create the relevant executable:
make extract
Then run the results script against the provided Defender executable.
./reference/rom_extract -d -v -i ./reference/DEFENDER.EXE -o ./reference/defender.rom
I should note that my rom_extract.c
is a modified version of a C program that's existed since January of 1996, called romgrab.c
, written by Jonathan Wolff. I don't have a whole lot of details but Jonathan's program was originally written as a utility to grab the ROM files from the Williams Arcade executables.
There is also an Atari 2600 disassembly provided. You can see defender.asm
in the reference
directory. This is from the 1982 version of the game. You can use DASM to assemble this code.
dasm defender.asm -f3 -odefender.bin
The Historical Source repository provided the original source code for Defender.
The Defender section of Computer Archeology provides a great deal of info on the internals.
The Williams hardware identification repository was extremely helpful in untangling the PCB information.
The Defender entry at Museum of the Game is useful for lots of historical information.
This project benefitted massively from Rob Hogan's defender repository. What I have done is clean up a lot of the source, provide consistency to the scripts, and include the reference implementations so that all work could be entirely recreated. Rob's version also did not actually provide for the full materials that would allow the game to be played in an emulator.