1989 · Melbourne House

Aaargh!

This minisite was contributed by Nico-van-der-Zijden. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/aaargh with me to Gold.

Two monsters smash cities for eggs, and on the Commodore 64 two players can smash them at once. The game never counts the eggs: every fourth city is the volcano, and then the round starts again.

01 · The game

A giant monster against a small city

You are a giant monster on an island of small cities. You knock the buildings down, burn them, eat the people, and look for an egg in the rubble.

The title screen
The title. Fire on joystick port 2 starts the lizard, fire on port 1 the ogre.
The lizard in the jungle village
The lizard in the first city, a jungle village.
The volcano
The volcano, with its golden egg in the mountain's mouth.

Each city has six buildings, a few people, two hornets, a white flyer, and a cannon that rolls along the ground and shoots. A monster punches a building with fire and a direction, or breathes flame with fire alone. A building that falls can leave something in its rubble: a lightning bolt, a hamburger, a box that hurts, or the city's egg. Taking the egg ends the city, and the two monsters fight for it in a cave.

Aaargh! was a Mastertronic arcade game in 1987. Binary Design made this version for Melbourne House in 1989: written by Vicious Fish, with art by Eric Casey and the Picturelement and sound by Wally Beben.

02 · Two players

The ogre joins a game that is already on

The manual says the C64 version takes one joystick, in port 2. The code reads both.

The lizard and the ogre in the same city
A game of the lizard's, a moment after fire on port 1. The ogre has walked in from the right, and both scores and both pairs of bars are up.
The title with the hidden names showing
The title with 1, ←, CTRL, and 2 held: the monsters are renamed Myrtle and Dill. The hidden names are on the Discoveries tab.

Numbers written with a $ are addresses in the computer's memory, in hexadecimal; each one links to the game's code on the Source code tab. Every routine that moves a monster takes the monster's number in the processor's X register: 0 for the lizard and 1 for the ogre. The stick is read with one instruction, lda $DC00,x at $8A43, which reads the address $DC00 plus X. With X at 0 that is port 2, and with X at 1 it is the next address, $DC01, which is port 1. So the lizard is always on port 2 and the ogre always on port 1.

While a monster is out of the game, fire on its port brings it in ($8A94), at its place for that city and with full bars. That works once a game: the flags at $8366 and $8367 stop a monster that has died from coming back. The game is over when both are out.

StickWithout fireWith fire
Upwalk into the screenpunch the building above
Downwalk out of the screenpunch the building below
Left, rightwalk that waypunch the building that way
Middlestandbreathe flame the way the monster faces

03 · Music

Music: Wally Beben's tunes, played by the game's own driver

The title tune and the cave's tune, played by the game's own music driver.

The game's own driver runs on the site's model of the 6502, from the listing's bytes: a button writes the tune's number to $68F7, as the title does, and then calls $68F8 once a frame, as the title's interrupt does. test_music.js runs the game's own code beside it and compares every write to the sound chip, frame by frame.

The driver plays three voices, each reading an order list of patterns. A pattern byte below $60 is a note; others set the note's length, its instrument (32 of them, eight bytes each at $7021), the speed, a slide or an arpeggio. A few instruments are drums, which step through a short table of waveforms and pitches. In play the same interrupt runs the sound effects instead of the music, so a city is silent but for its effects.

Sound: the effects

Each effect is a 16-byte record at $7778: a frequency, a step and a mode (rising, falling or swapping), a time, an envelope and a number of repeats. A button asks for it on the third voice, as the game does with $753E, and runs the effects player ($753F) once a frame, as the play interrupt does. Ten of the 26 are used; the names say where.

04 · One frame

Sixteen sprites, by splitting the screen in two

A frame of play drawn from memory by the page, not a screenshot. Press a button to see what each band of sprites adds.

The frame was recorded in the emulator (every write to the video chip, with its line and cycle) and is drawn here with the site's model of the chip. The drawing matches the emulator's own picture of the same frame in all 104,448 pixels.

A sprite is a small picture the video chip draws over the screen, and the chip shows eight at a time. The game shows sixteen by moving them half-way down the frame. An interrupt is a routine the processor runs when the video chip signals that its beam has reached a chosen line of the picture. The interrupt on line 0 ($8810) places the first band: the two hornets and the white flyer. A second interrupt ($88A2) comes just above the monsters and places the second band: each monster as three sprites (its legs, its body and a punching arm) and the cannon as two side by side. Its line moves with the monsters: each pass $9B4F writes it into $889E, 26 lines above the higher monster's legs, which is just above its body.

When the ogre stands lower on the screen than the lizard, nearer the player, $9AF8 swaps the two monsters' sprites. The nearer one then has the lower sprite numbers, and the video chip draws those in front.

05 · The monsters

A monster's legs are rebuilt every pass, to walk behind walls

Each monster is two sprites, legs and body, with 17 animations of four frames. Pick one.

The body's frame is a sprite pointer from $80EF (the lizard) or $8177 (the ogre); the legs' frame is one of 98 shapes at $0BB8, by the tables at $8133 and $81BB. Both come from the listing's bytes.

The bodies are ordinary sprite shapes, most of them in memory under the input and output chips and under the KERNAL (the machine's built-in program), where the processor never reads but the video chip does. The legs are not shown from where they are kept. Each pass, $9772 copies the legs' frame into a buffer at $9D12, and $9811 looks at the screen cells around the monster's feet. The screen is a grid of characters, tiles of 8 by 8 pixels, each with a number. Where a cell holds a wall or a building's front (a character numbered below $A0), the routine clears that part of the frame. The result goes to the sprite at $CC80 or $CD00, so a monster's legs disappear behind a wall as it walks past.

A monster moves a cell every second pass. The cells under its feet must hold characters from $A0 up, and the cell ahead one from $95 up or the city's floor character. It cannot walk into the other monster.

06 · The cities

Three cities, then the volcano, for ever

The manual promises twelve cities and the volcano after five eggs. Roll a round to see what the code picks.

The picker at $8444 reads the table at $842F at four times the city count plus a random number from 1 to 4. The roll here uses the same table, read from the listing; test_rounds.js checks it against the game's own picker for every count and number. Every place is drawn on the Maps tab.

The city count at $803E goes 1, 2, 3, 4, and back to 1. The first city is the jungle village or the temple in the mountains, the second the castle or the wild west town, the third the town by the water, the city in the cave or the pyramids, and the fourth always the volcano. That makes seven cities, not twelve. Nothing counts the eggs, so the volcano comes every fourth city, whether or not a monster has taken one. Its golden egg is drawn on the screen from the start ($87A1). Taking it leads to the cave, as any egg does, and the next city starts a new round. The game has no ending: it goes on until both monsters are dead.

07 · Smashing

Punches cost power, flames are free

Each monster has two bars beside its score: the top one is its health, the second its punching power.

The four pickups
The four things a fallen building can leave, drawn into the screen in their own colours: the lightning, the hamburger, the box that hurts, and the egg.

A punch knocks a hole in the building that way ($B44A), scores 100 and starts it on its way down, but only while the monster has punching power ($80ED), and each punch spends a cell of the second bar ($92D6). With the bar empty, a punch does nothing. A flame needs no power: it burns the building a little every second pass for 10 points a time, and burns the hornets, the white flyer, the cannon, and the other monster too.

A building goes through stages of fire ($93F0), its rows burning down, and then falls ($95D9). What it leaves in its rubble is picked at random from the table at $9C12: nothing, the lightning, the hamburger, the box or, if the city's egg is not out yet, the egg. The sixth building to fall holds the egg if no other has. The lightning fills the punching bar, which the manual says makes the flames stronger. The hamburger adds health, and so does a person eaten; the box hurts eight times. Before a punch or a flame the monster eats a person in reach or takes a pickup under it ($914E).

A hurt takes a step off the health bar, five cells from full to empty, and an empty bar starts the monster's death ($931E). Points are added to the score one a pass, 10 on the screen each ($93AE), and a monster's best score goes onto the title when it dies.

08 · The city fights back

What a city sends against a monster

Everything that hurts a monster calls one routine, $931E.

WhatHow it movesHow it hurtsHow it is beaten
Two hornets ($A446)fly in from either side at the monsters' height, 4 pixels a passsting the monster higher on the screen, two hurtsa flame as it comes in, for 50 points
The white flyer ($A5CD)zigzags across and dives, 3 lines a passdrops something that falls a row a pass, two hurtsa flame at the bottom of its dive, for 50 points
The cannon ($A9B4)rolls along the ground, towards a monster that comes nearfires a shell up, down, left or right, one hurtflames take its health of 14 down; below 7 it breaks up

09 · The cave

With one player, the computer fights for the egg

Taking a city's egg ends the city in the cave, where the two monsters fight to five hits.

The two monsters fighting in the cave
The cave. Nobody steered the lizard here, and the computer's ogre won five hits to none.

The cave is a place of its own, type 9, built from the same data as the city in the cave but without buildings ($AC02). The monsters stand at fixed places either side of the egg, and the cave's tune plays. Left and right walk, fire punches and up ducks. A punch that finds the other monster within two columns, not ducking, counts a hit; on the fifth the other monster wins, and scores 500 if a person plays it.

A monster nobody steers is played by the computer ($AE01): with random chances it walks towards the other monster or stands, punches when it is close, or ducks. The winner walks to the middle and holds the egg up, and the next city follows.

10 · Chance

A table of random numbers that rewrites itself

Most of the game's choices read one table of 256 numbers from 1 to 4.

The table at $9C12 is read at a place kept in an instruction's own operand, the byte after the instruction that it works on: the ldx # at $A91D. Nearly every choice counts the place on by one and reads the number there: which way a person steps, when a hornet comes, what the rubble holds, which city comes next. Each pass of play writes a new number at the current place ($89CC), from a 32-bit shift register at $B7B0 that a routine steps eight times for each number ($B75E). The title counts the place on every pass too, so how long the title runs before fire is pressed changes the game.