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.

How the puzzle pieces are cut, what the pocket computer's keys do, how a robot decides what to do next, and what the clock and the score count.

01 · The puzzle pieces

Puzzle pieces are cut from the picture with masks

Each of the nine puzzles is a random picture, and each piece is that picture seen through two of sixteen stencils.

The puzzle's picture is made the way $B0F3 makes it, and its four pieces are cut by a port of $9C47.

A piece record is four bytes: the puzzle, a first mask, a second mask and a flags byte. Bits 0 and 1 of the flags say whether each mask is used as it is or inverted, so the four pieces of a puzzle are the picture cut along the first mask in both directions and along the second in both directions. Bits 2 and 3 flip the piece left to right or upside down.

The four pieces divide the picture exactly, and only the frame, which every piece carries, is common to them. Descriptions of the game say the pieces overlap, so that three can fit before you find you must start again. In this copy they do not. The pocket computer refuses to drop a piece where any other part of it would land on something already there (IMAGES CAN'T OVERLAP, $8037), and the frame is the one part it lets through.

A piece takes the background colour of the room it was found in ($98FB). Pieces of different colours cannot be put together (COLORS MUST MATCH), which is what the colour keys are for.

02 · The pocket computer

A keypad for flipping, recolouring and phoning

Fire in a lift or a corridor opens the pocket computer. The joystick then moves a pointing hand, and fire presses the key under it.

The pocket computer's screen with its keypad
The pocket computer.
The pocket computer showing the map of rooms visited
Its map of the rooms and corridors visited so far.
KeysWhat they doRoutine
Left keysScroll the memory of found pieces forward and back; the bottom one is the phone$7A9F, $7B32, $7BC2
Top rowFlip the selected piece upside down, flip it left to right, clear the slot$7901, $7968, $79E2
Middle rowSwitch off, undo, pause (TIME IS SUSPENDED)$3D94, $7A61, $3D78
Bottom rowRecolour the selected piece green, yellow or blue$7A29

A puzzle is solved when the pieces dropped into a slot add up to one of the nine solution pictures exactly ($80C3). The game then writes that puzzle's letter of the password into the PSW line and removes its pieces from memory.

The phone calls for help, at two minutes of game time a call ($7D9D). One number turns the two pieces in the memory window the right way up. The other counts the pieces of the leftmost piece's puzzle and answers A SOLUTION EXISTS when there are four, NEED MORE PIECES when there are fewer ($7FD7). The tones it dials are on the Sound tab.

The security terminals

Stand in front of a security terminal and push up, and it offers to reset the room's lifting platforms or to disable its robots for a while, each for one password of the matching kind ($9D16, $A0DE). The pointer starts on LOG OFF.

A security terminal screen with its menu
A security terminal. The number after SECURITY TERMINAL is the room's.

03 · The robots

Each robot runs a script

The robots' behaviour is a bytecode, interpreted once a frame from the raster interrupt.

Each robot has a pointer into a 256-byte script table at $2112, a current command with a count, and a mode ($8ECC). The commands test which side of the robot the agent is on, whether he is on the same level (within 20 lines) or a random bit, and skip the next command or not. Others jump, wait, turn the robot one step at a time through seven sprite frames, walk it along its platform, or fire the zap. A robot stops where its floor ends ($90FB), so a robot can never walk off a ledge.

The 32 behaviours a game can give a robot are 32 starting points in that table ($2212). This is how one robot ignores the agent while another turns to face him and fires. The floating ball runs a second, simpler language from $2232: wait, step, home in on the agent, loop with a counter ($92CB).

Touching a robot or its zap kills the agent, through the sprite collision register ($9504). The room restarts with the agent at the door and ten minutes gone from the clock ($95E4). A snooze password stops the robots and the ball for 764 frames.

04 · Time

Six hours on the clock, 7 hours 12 minutes on a PAL machine

The mission has until six o'clock, and the clock counts 60 frames to the second.

The clock starts at 12:00:00 and counts in decimal ($83A2). Its seconds are 60 interrupts long, which is a second on an American NTSC machine. A European PAL machine shows 50 frames a second, so there a game second lasts 1.2 real seconds, and the full six hours take 7 hours 12 minutes. The PAL patch at $3FB9 corrects only the ending's lip-sync (The ending, below).

EventCostEvidence
Death10 minutes$96F9; tested: 12:24:47 became 12:34:47
Phone call2 minutes$7D9D
Pause buttonclock stopped$83A2 checks $D5

05 · The score

Time left is worth more than everything else together

ItemPoints
Puzzle piece found100
Password found100
Puzzle solved500
Each second left before six o'clock, if the mission is complete1
Mission complete1,000

Every piece, password and puzzle in the game add up to 9,900 points; finishing with five hours left earns 18,000 for the time alone ($BA08). The hall of fame keeps fifteen scores and five-letter names until the machine is switched off ($BC04).

06 · The ending

Elvin, finally face to face!

Win, and the screen switches to a full-screen picture of Professor Elvin Atombender, who talks while the lights of his control room twinkle.

Drawn from the bytes the game keeps under the I/O area: the glyphs at $D000, the screen at $DC00 and the colours at $F800, in multicolour with the three colours the game sets at $AADF. The mouth is 13 cells; the game swaps them between the glyphs at $AB93 and $ABA0. A screenshot of the same moment is here. The play button speaks his line through the speech player of Sound and moves the mouth on the same clock.

The picture lives where the program cannot easily read it. At start-up the game switches every ROM and chip out of the way and moves three blocks into the RAM beneath them ($71C0): 2 KB of glyphs to $D000, the screen to $DC00 and its colours to $F800. The ending points the video chip at the last 16 KB of memory, where it can see that RAM, and copies the screen and colours into place ($AA40).

He says voice line 4, "No! No! NO!" The game starts the line and carries on at once, because the speech plays from a timer interrupt ($AB23). While it plays, the game opens and closes the mouth three times, once for each no, and on every frame gives six random cells of the control room new light colours ($ABBA).

The mouth moves in seven steps, each lasting its entry in a table plus one frame, and there are two tables. On a PAL machine, the start-up patches three instructions so that the ending reads $AB6E instead of $AB67 ($3FB9). The PAL durations are five sixths of the NTSC ones, because the PAL picture runs at 50 frames a second, not 60, while the speech plays from a timer that counts processor cycles, and the two machines run their processors at almost the same speed.

The game adjusts nothing else. The game clock still counts 60 frames to the second, so on a PAL machine the six hours last 7 hours 12 minutes (The clock, above).