1989 · Firebird

Rick Dangerous

This minisite was contributed by air, 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/rick-dangerous with me to Gold.

What the game keeps from the player: two names for the Hall of Fame that turn on a cheat and a level select, a floor in Egypt that throws Rick twice as high as a jump, a joystick in the wrong port that quits the game, an object drawn at the wrong edge of the screen, and a line of its own source code.

01 · The cheat

Secret: two names change the game

A score good enough for the Hall of Fame lets the player spell a name of up to ten letters with the joystick. The routine at $2146 then compares the name with two words kept at $21B8. BBOOIINNGG turns on two cheat keys ($53): 2 fills the bullets, the dynamite and the lives back to six, and C= jumps to the next level. FLUFOMATIC ($37) turns the title screen into a level select, offering every level reached so far ($51).

The title screen with SELECT LEVEL and four levels listed: South America, Egypt, Schwarzendumpf Castle, Missile Base

Before either check, $2103 looks for eleven rude words in the name and writes SNIGGER over any name that holds one. The search is looser than it looks: it takes each word's letters in order anywhere in the first seven letters, with other letters between them. Type a name to see what the Hall of Fame keeps.

The level select, after FLUFOMATIC, with all four levels reached. The name box runs a port of $2103 and $2146, checked against the game's own routines on 3,000 names in the kit's 6502 simulator (test_names.js).

The level select has one more condition. A game started from it does not show the ending: $23A0 skips the story screen for the fifth "level" when the start was chosen ($52). A player who took the shortcut finishes on GAME OVER.

02 · Springy floors

Secret: a floor in Egypt is a trampoline

One kind of tile carries a flag no other solid tile has ($20, How it works, section 02). Landing on it does not stop Rick. The code at $0BFE turns his speed round, less a pixel, and sends him back up, and each bounce starts half a pixel a step slower than the one before, until the speed is one and he stands. Holding the stick up as he lands sends him up at eight pixels a step instead ($0BED), the top speed the game allows: 68 pixels, twice the height of a jump. The movement picture on How it works shows both with "Springy floor" pressed (section 04).

The two places the maps hold springy tiles, outlined: a strip of 24 across one room of Egypt (level 2, map row 86, codes $BE-$C0), and four under a pair of crates in Schwarzendumpf Castle (level 3, map row 51, code $D8). Levels 1 and 4 have none. The bounce was read from the code and run in the simulator, not watched in play.

03 · Controls

Secret: a second joystick can end the game

The manual gives the up-arrow key for quitting. The game reads ← instead: $0A95 tests one bit of the keyboard, and pressing ← ends the game. That bit is shared with joystick port 1, because the game never changes which keyboard row it reads ($DC00 stays at $7F). A joystick left in port 1 and pushed down ends the game too, and pushed right it is the cheat's 2 key.

Run/Stop, on the same keyboard row, pauses the game until it is pressed again ($40E0).

04 · Sprites

Bug: an object at the right of a room can jump to the left edge

A sprite's X needs nine bits on a 320-pixel screen, and the ninth bits of all eight sprites share one register ($D010). The sort works the ninth bit out for each reused sprite in turn, each from the last: $3978, then $397A and $397B. For the third and fourth it writes its result to $3980 and $3981 instead of the next two bytes, $397C and $397D. Then, every frame, $36D9 copies $397C and $397D over them. Nothing writes those two, so the handler at $387D always gets a zero.

An object's sprite X is its X plus 56, so every object 200 pixels or more from the left of the room needs the ninth bit. Shown on sprite 4 or 5 below the others, such an object is drawn 256 pixels to the left, at the left edge of the screen and mostly in the border. It takes nine objects in view, with this one the ninth or tenth from the top, so it can only happen in a crowded room. Found in the code; "Show the bug" under the sprite picture on How it works (section 10) sets up a room where it happens.

05 · The Hall of Fame

Secret: the Hall of Fame can change at power-on

At power-on, $226A reads the line the video chip is drawing and uses it as a random number. When the line's top bit is set and its three low bits are not all zero, about seven times in sixteen, it copies NOBBY or JEZEBEL ($2368) over one of the first seven names. The names are stored column by column ($2318): the first letters of all eight names, then the second letters, and so on.

HALL OF FAME in orange capitals above eight names with scores from 8000 down to 1000

The Hall of Fame the game starts on. JEZEBEL is one of the two names $226A can add.

06 · Leftovers

A line of the source code, loaded with the game

The sprite multiplexer's buffers at $3963 are overwritten in the first frame, but before that they hold plain text: RICK_MASK,Y, a line break, !124, a tab and S. It is a fragment of the game's own assembler source, left in memory on the developers' machine when the game was saved.

Other things the finished game never uses are still in it: a collision test nothing calls ($1CB1), a memory swap ($2524), and a routine that writes a byte as eight binary digits ($414E). Holding SPACE while a room is built copies the map rows above the screen over its bottom eight rows ($2FD5). The start-up calls $4108 once to build the object-type tables and then writes an LDA over its own JSR ($0864), so the call never happens again.