1990 · Rainbow Arts · Commodore 64

Turrican

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

Manfred Trenz’s game loads its thirteen levels one at a time from the second side of its disk. The hero’s shots, his whip of lightning and his energy lines are drawn into the screen as characters, which leaves the sprites free for the enemies and the bosses.

01 · the game

The hero fights through five worlds in an armoured suit

Turrican has thirteen levels in five worlds: three levels each in worlds 1, 3 and 4, and two each in worlds 2 and 5. The first side of the disk holds the game itself. The second side holds a file for each level and one for the ending, and the game loads the next level from it when a level ends. Each level has a time limit, from 201 to 601, which counts down by one every second. When it reaches zero the hero dies.

The hero runs, jumps and ducks with the joystick. A short press of fire shoots. Holding fire brings out a whip of lightning that the joystick swings round, and holding fire while he ducks lays a mine. The space bar sends out two energy lines that sweep across the screen, and F7 throws a grenade. Down with the space bar rolls him up into a wheel that cannot be hurt, three times a life. Containers and hidden blocks leave coloured symbols behind: red for a scatter shot, green for a laser, blue for a longer whip, and others for a shield, energy, more grenades, mines, energy lines and lives.

He starts with three lives and three continues. Each diamond he picks up is worth 50 points, and every 300 diamonds give him another continue. Every world has at least one boss, and most of them fill much of the screen.

Level 1-1 in play

Level 1-1, about eight seconds in: the hero on the first world’s rocky ground.

02 · music

Music: only the title, two levels and the ending have tunes

The levels the hero plays on foot have no music. All three voices of the sound chip are left to the sound effects. Level 3-1, a flight up a shaft, and level 3-3, a dive down another, each bring a tune and a player with them, and they switch the sound effects off while the tune plays ($0207). The title holds two tunes, one for its pages of credits and one for the hall of fame, and the ending has a tune of its own.

Three of the players are one program. The title’s player at $9BD0, level 3-3’s at $6C00 and the ending’s at $A400 are the same code, byte for byte, at three addresses. Each plays a module: a list of positions for each voice, patterns of notes, and instruments. Level 3-1 carries a smaller player of its own at $6C00.

The ending’s tune has a fault: one of its sound programs points into the game’s code, so for a few seconds at a time a voice plays the code’s bytes as notes. Discoveries explains it.

The sixth tune plays while the game loads, over the loading picture. The boot program reads it from sectors of the first side that the disk’s directory does not list, together with its player, which names itself Romuzak V6.3 in its own bytes.

Each button runs the game’s own player for that tune on a 6502 simulator in the page, with the player’s code and the tune’s bytes from the Source code tab’s listing, or from the boot’s sectors for the loading tune. The filter is modelled on one 6581 chip. On this page ten bytes of text inside the loading tune’s player are changed, to leave out a telephone number, and the tune plays the same. Discoveries says why the change needed care.

03 · sound effects

Sound: an effect starts when a routine writes its number

The engine plays the sound effects with a player of its own at $4F09, called once a frame. A routine that wants a sound writes the effect’s number, from $81 to $A7, into the request byte of one of the three voices: $FFC0, $FFC7 or $FFCE. The player starts the effect’s program on that voice and sets the byte back to 0 when the effect ends. Each program is a short script ($4F3B). Its first byte says which parts follow: the envelope, a list of pitches, a list of waveforms, a pulse width and how it sweeps, and the filter.

The engine’s routines and the levels’ routines use the same numbers, and each picks the voice. The hero’s shot always takes the first voice. Most enemies, in every world, make sound $98 when a shot hits them. Three numbers, $84, $8D and $97, lead to the same programs as $85, $8E and $98, and the game never asks for them.

Each button runs the engine’s own effects player on the 6502 simulator and writes the effect’s number into the voice the game uses for it, or two numbers where the game starts two sounds together. A sound that repeats until the game stops it, such as the held whip or the lift, plays for four seconds.

04 · the screen

The play area and the panel come from different memory

The video chip draws the screen in two parts, from two of its four banks of memory. The play area comes from the fourth bank: multicolour characters from the level’s character set at $C000, on a screen at $C800 or $CC00. The game draws the next view on the screen not on show and swaps the two as the view scrolls a whole character ($16E0).

An interrupt at line 213 ($0BF0) switches the chip to the first bank for the panel: a screen at $0400 and a character set at $0000. The panel’s own characters, from $80 up, are therefore read from $0400-$07FF. That kilobyte holds the panel’s four rows of screen, the shapes of its icons and digits, and some of the engine’s own tables, each placed where the panel never shows a character. The interrupt hides the moment of the switch by setting an invalid mode for the line above the panel ($D011 = $5F with multicolour on), which the chip draws black.

One frame of level 1-1, drawn from the memory and the video chip’s settings the frame used, recorded in the emulator. The button leaves out every change the game makes to the video chip from line 213 on, so the panel is drawn with the play area’s settings.

05 · levels

A level is a map of blocks four characters square

Level 1-1 is 137 blocks wide and 51 blocks high. Its map is stored a row at a time from $8E00, and the width at $ADE0 is the step from one row to the next. Each byte of the map is the number of a block, and each block is 16 bytes at $B000: four rows of four character codes. Every character has a colour in the table at $AE10. A colour of 8 or more draws the character in multicolour, with the level’s two shared colours at $ADF1 and $ADF2. A second table at $AF10 tells the engine what each character is to the hero: open space, a wall, a diamond he picks up, or a hazard that hurts him.

The enemies are kept apart from the map. The level divides its map into squares of 32 by 32 characters and keeps a list of objects for each square, six bytes to an object: its type, its state and its place ($8CCF, $8D51). Each frame the engine reads the list of one of the four squares around the view ($5923). An object less than 44 columns to the right of the view’s top left corner and less than 23 rows below it goes into one of eleven slots, and its type in the list is set to 0. So each enemy starts once. One that is destroyed, or scrolled off the screen and removed ($5A53), does not come back when the hero goes back for it.

The eleven slots share five of the machine’s eight sprites. Each time the beam passes one of the five, the engine moves that sprite further down the screen to show the next object ($5A9A).

A view of level 1-1’s map the size of the play area, 40 characters by 21, drawn from the level’s map, blocks, character set and colours in the listing. It starts where the level starts the view ($ADF3). The map is drawn as the level loads it, so every diamond is still in place. The enemies and the hero are not part of the map, so they are left out. Blocks and squares draws a thin line around every block and a thick one around every square of 32 characters.

The Levels tab draws all thirteen maps whole.

06 · weapons

The hero’s shots are characters drawn into the screen

The game spends its sprites on the hero, the enemies and the bosses. The hero’s shots, the laser, the whip, the energy lines, the grenade and the mine are characters from $D8 up, drawn into the screen and moved a character at a time. An enemy finds out it has been hit by looking at the screen under it for one of those characters ($5FB0). The character it finds says how much energy the hit takes from the levels’ tougher enemies, which keep an energy count of their own, from a table at $0720:

CharactersWeaponEnergy taken

The values are read from the engine’s listing as the page loads. The whip is drawn with 14 characters, and each one takes 1. The first pieces of a broken wall take 211, the most in the table, and the sparks take nothing.

Two weapons do most of their work outside the table. When the grenade explodes, every other object on the screen explodes with it, except in a boss’s level and in a level that runs its own sprites ($2E6C). There it takes 99 through the table. The mine takes nothing through the table: while its blast lasts, the levels’ walkers and gunners leap off the screen ($2DB2, the flag at $0305).

The whip is a line of these characters from the hero’s chest, and its length is a count of characters ($036F). It starts at 16. Each blue symbol adds 2, up to 40 ($5E69), and each life lost takes 4 away, down to 16 again ($565D).

The Discoveries tab shows what the pause key does to all of this when fire is held with it.

07 · hidden blocks

Shooting a hidden block brings out bonus symbols

Most levels hide blocks in places that look empty. A block shows only when a shot passes through its place. From then on it is solid: the hero can stand on it, and jumping into it from below bumps it. More shots make it throw out bonus symbols, until it breaks. The 101 blocks are objects in the levels’ lists, like the enemies, and each level brings its own code for them, so the rules change from level to level:

LevelsBlocksWhat the shots doHow it ends
1-13Every fifth hit throws out a symbol, a weapon, the shield, P, G, M or L, with 500 points ($85EC).After ten symbols, the next fifth hit blows it up for 5,000 points: 55 hits in all.
1-2, 1-37, 3The first shot opens it. Then every fifth shot (the fourth, the first time) throws out a symbol with 500 points, never a 1UP or a diamond ($76B4, $7CC7). 1-2’s blocks can be seen before they are shot.After 15 symbols in 1-2, or 10 in 1-3, the next count blows it up for 5,000 points.
2-1, 2-2, 3-2, 4-34, 3, 21, 10A large block of four sprites. The first hit shows it ($7C78, $7460).Twenty more hits burst it: every object on the screen, enemies included, turns into a symbol.
4-114Each shot after the first knocks it a step the way the hero faces and throws out a symbol with 500 points ($7ED9).The eleventh shot destroys it, for 200 points.
4-2, 5-1, 5-210, 22, 4It flashes while shots hit it, and every fifth frame of hits throws out a symbol with 500 points ($82AC, $790A).After 15 symbols, the next destroys it, for 5,000 points.

The counts are the blocks in each level’s lists. Each level’s name links to its map on the Levels tab, where a button steps through the blocks one at a time.

The two flights, 3-1 and 3-3, have no hidden blocks. Their prize drones zigzag across the shaft, firing, and each turns into a symbol when it is shot, with 400 points ($75CF, $7DDF).