Showing posts with label arcade. Show all posts
Showing posts with label arcade. Show all posts

Tuesday, 25 November 2014

Rocket Raid Under The Hood 2: Disassembly Tools and References

This is the second part in a series of posts on digging into the code of the Acornsoft side-scrolling arcade game, Rocket Raid.

There are a number of tools that we will need in order to dig into the code of Rocket Raid, and some books that will come in handy.

Software Tools


First is a BBC Emulator for running the game and for its debugger/monitor feature which allows memory locations to be updated on the fly. I will be using the excellent BeebEm.

The disassembler BeebDis, by Phil Harvey-Smith, allows game code to be turned back into assembly language instructions for closer examination. Not only that, but the assembly instructions can be modified for reassembly which will be very useful for investigations.

BeebAsm, by Rich Talbot-Watkins, is an assembler which will allow assembly code to be assembled into machine code for running on the emulator. The BeebDis assembler produces code in a format that is compatible for feeding into BeebAsm.

BBC Explorer by Laurie Whiffen. This easy-to-use GUI-based utility allows the contents of a BBC disc to be extracted into individual files, and is compatible with various emulated disc formats.

Reference Material


The Advanced User Guide
One useful reference manual is the BBC Advanced User Guide, which can be downloaded from here. This guide was the companion to the standard User Guide for the BBC, and contains a wealth of information including operating system calls, memory locations and assembly language instructions.










Creative Assembler
 by Jonathan Griffiths
As mentioned in the previous post, Jonathan Griffiths wrote a book called "Creative Assembler - How To Write Arcade Games" which is available online here. Inside are a number of assembly-language routines with comments by the author which will hopefully help shed light on some of the code found in the Rocket Raid game.








And Last But Not Least...

And of course we will need to obtain a disc image of the game itself, which can be found on various websites such as Stairway To Hell.

Monday, 24 November 2014

Rocket Raid Under the Hood 1: Introduction

Acornsoft

In the early days of the BBC Micro, the quality of software for the new machine was quite mixed. However one software company in particular, Acornsoft, seemed to be able to consistently produce games of high quality that earned favourable reviews, including a range of games that were clones of, or closely based on, popular arcade games of the time such as Snapper (a clone of Pacman), Planetoids (a clone of Defender) and Rocket Raid (a clone of Scramble).

Rocket Raid

Rocket Raid was written in 1982 by Acornsoft programmer Jonathan Griffiths, who also created the classic Snapper for the BBC & Electron (and, later on, JCB Digger for the BBC).
Rocket Raid - disc version cover

The game will no doubt be familiar to most people who have owned a BBC micro. In the game, you must guide your rocket ship through a hazard-filled landscape (which includes vertically-rising rockets, alien-filled tunnels and an asteroid belt) through to the last level where success if found by bombing the robot waiting at the end.

As soon as you fired up the game the first thing that hit you was the smooth and fast horizontal scrolling which gave it a sense of frantic action. The difficulty level of the game is fairly high and it was likely that a newcomer to the game would find it all over in a matter of seconds. But the gameplay was very addictive and I remember devoting many hours to working out how to weave through the cave in the second level without running into the aliens, and later on trying to navigate the near-impossible vertical rises and drops of the yellow tunnel level. The sprite collision detection did seem to be a little dodgy at times though, with rockets miraculously surviving your barrage of bullets for you to run unceremoniously into them and disappear in a ball of flames.

The game ending was also a slight let-down. After battling through to the very end of the game and managing to successfully drop a well-positioned bomb on the final robot enemy, you would receive a short congratulatory message and find that the game simply started again.

But players in those days were used to brief game endings (or none at all), especially given the limited memory space into which the games had to be squeezed.

Rocket Raid - first level

Coming Up

In this series of blog posts we'll try to disassemble the Rocket Raid code to see how it the game was put together.

Some of the areas of interest include:

  • sprite plotting and movement
  • collision detection
  • hardware scrolling
  • sound
  • text display
  • text input

The game was written in 6502 assembly language and runs in Mode 2, giving use of the full set of 8 colours (plus 8 flashing) at the expense of losing 20K of memory for screen display, leaving only a few kilobytes of memory on an unexpanded Beeb for the game code itself.

One book that will be a very useful reference is one that was written by the author of the game soon after the publication of Rocket Raid, called "Creative Assembler - How To Write Arcade Games" which should give some insight into similar assembler routines used in Rocket Raid. (Despite its name, I found the book itself to be rather dry and fairly hard to digest, at least in terms of a games-writing guide, but for our purposes it is likely that some of the routines mentioned will be similar to those found in Rocket Raid).

In the next post I'll make a quick summary of the tools and books before we roll up our sleeves and start to take the code apart.