Sunday, November 25, 2012

OutRun Toolchain & Bootloader

Here's an amazing project from blog reader Alex Bartholomeus (aka deadline). It's a hardware interface, gcc based toolchain and software bootloader for the OutRun boardset. It allows you to upload and execute C or assembly based software on the original hardware.

The Hardware

The connecting hardware is veroboard/prototyping board based, and uses simple TTL buffers/inverters (74HCT04). The interface partially implements the IEEE1284 spec as the basis for communication. The hardware utilises the unused digital input pins on the port that has the start and coin inputs. There are 16 in total, and these can be read as is done in the game. Output is achieved through bits connected to the start light, brake light and external mute. 

The Bootloader

The bootloader is coded in 68000 assembly and must be programmed to the master CPU eproms. It implements the protocol without using any RAM (not even the stack), so that everything can be overwritten by the uploaded code. It also forwards interrupts from ROM to the same locations in RAM, so it's transparent to build binaries for uploading or plain eprom images. The interface only supports uploading code into RAM so it's limited to 2x32kb banks, minus the actual memory one would need. So uploading a complete outrun image would be impossible. But splitting the data (if there is any) and keeping that in the upper 2x256kb of ROM would be feasible.

The Toolchain

The toolchain consists of cross-gcc (C only), some linker scripts and a basic supporting library. The bootloader source code offers a nice example of how to code a basic program to run on the hardware. 

Some videos of the setup can be found here and hereAlex plans to release the package including schematics and source code at some point soon. Then we can have an oldskool demo coding competition or similar! 

No comments: