1984 · Epyx

Impossible Mission

This minisite was contributed by chunkypixel, 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/impossible-mission with me to Gold.

One joystick in port 2 plays the whole game: the agent, the lift, the pocket computer and the terminals. The keyboard is read only when the hall of fame asks for a name.

01 · The stick

Left and right walk, fire somersaults, and up searches only while he stands still

Press the stick and fire below, or click the picture and use the arrow keys and the space bar. The agent answers the way the game's own routines would, a tick at a time on a PAL machine.

The game reads the stick in port 2 straight from the chip, at $DC00: five bits, each 0 while its direction or the button is held. Three routines share the work. The room's loop ($7249) runs every tick; it counts each new press of fire ($51, with $DE set while the button stays down, so holding it counts once) and sends up to the search when the agent is standing still. Every third tick the agent's update reads left and right ($87ED), moves him ($8859) and picks his next frame ($8817).

Left and right set the facing and a step of five pixels. With neither held the agent drops straight to his standing frame and stops: there is no slowing down. A counted fire press turns any walking or standing frame into the first frame of the somersault, and the somersault then runs its twelve frames with the stick ignored. Its steps come from tables ($8D07-$8D42), not from the walking speed, so from the moment he leaves the ground a standing somersault carries him as far as a running one. On the last frame the stick is read again: he lands running if left or right is held, and standing if not.

Up wins over everything else while the agent stands. When up is held and he is on his standing frame, the room's loop calls the search ($92A0) instead of the agent's update, so pushing the stick up and to one side leaves him standing where he is. Down does nothing in a room unless he stands on a lifting platform.

02 · What the stick does where

Each part of the game reads the stick in its own loop

There is no table of controls in the program. Each loop reads $DC00 itself and decides what a direction means there.

WhereStickFireRead by
In a roomLeft and right walk. Up, standing in front of furniture or a terminal, searches it or switches it on.Somersault, from walking or standing$7249, $87ED
SearchingHold up. Letting go stops the search; the time left is counted down in the object's own record ($4F59), so pushing up again carries on where it stopped.Not read$98C2
On a lifting platformUp raises it and down lowers it while he stands on it, once for each push of the stickSomersault$AC88
At a security terminalUp and down move the pointer between the choices, once for each pushCarries out the choice$9F6A-$9FA7
In a corridor or the liftLeft and right walk. In the lift car, standing, up and down start the lift; it then runs on by itself to the next level with a door, and pushing the other way on the way turns it round.Standing, opens the pocket computer; walking, a somersault$39CF
The pocket computer and the code rooms' screenMoves the hand one pixel a tick, within the panelPresses the button under the hand, once for each press$3DC2, $3AD8, $A808
A message, or the pause button's TIME IS SUSPENDEDNot readWaits for fire to be pressed and let go$81F7

The lift is the one place where a short push does a long job. Once up or down has started the car, the loop keeps calling $8592 or $855C until a corridor's opening is level with the car ($1F or $20 = $0B), reading only the opposite direction on the way. At the top or bottom of a shaft the car stops whatever the stick says ($1D, $1E). The pocket computer's buttons, the phone among them, are on How it works.

03 · The keyboard

Five characters for the hall of fame, and three keys that delete

Type a name, by clicking the keys or with your own keyboard while the picture of the keyboard has the focus. Each key shows the character the game's table gives it; the faded keys give nothing.

The game scans the keyboard itself ($BE2D) rather than through the machine's ROM, which it has switched out. It drives the eight rows of the keyboard one at a time through $DC00, from the row of RUN/STOP and SPACE down to the row of DEL and RETURN, and reads the columns at $DC01. The first key it finds is the one it keeps, and a 64-byte table ($BE78) turns it into a character. A key counts once, until every key has been let go ($DF).

The table gives every letter and digit, and a few signs: the full stop, the asterisk, and the equals sign, which the minus key types as well. SPACE gives character $FD and the colon $98, neither of them the blank or the colon of the game's own texts. Three keys delete: DEL, the left arrow at the top left, and cursor right. RETURN ends the name early; a fifth character ends it at once. The shift keys, the function keys and the rest give nothing.

The name is taken from the screen, five characters from where it was typed ($BD61), and kept with the score at $CF00 until the machine is switched off. While the name is typed, RUN/STOP is ignored ($BD24). After it, the game waits for RUN/STOP alone and then starts a new game ($B89D).

04 · RESTORE

RESTORE starts a new game from anywhere, except while a voice line plays

The RESTORE key is wired to the processor's non-maskable interrupt, not to the keyboard's rows. The game points that interrupt at $388C, the part of its start-up that sets up a new game ($BECD), so pressing RESTORE at any time abandons the mission and starts again in the lift. The hall of fame's prompt, HIT RESTORE OR RUN/STOP FOR NEW GAME, names both ways.

While a voice line plays, the speech driver uses the same interrupt for its samples, nearly ten thousand a second, and points the vector at its own handlers in page $08. RESTORE then lands in the speech driver and starts nothing. The start-up, a death and the end of a line point the vector back at the new game ($BEC2). The speech is on Sound.