1985 · Domark

A View to a Kill

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

Five programs that never load each other, the codes that link them, and the code they share.

01 · Five programs

Each section is a whole program that fills the memory

Nothing in any section loads another. Each is unpacked over the whole of memory and runs until the player loads the next one.

ProgramStarts atScreenSound
Intro$8020a scrolling bitmap on two banksthe Bond theme, speech
Paris$43B0characters, split in threea tune, effects, speech
City Hall$1000characters, split in fivethe Bond theme, effects
The mine$5660characters, scrolling both waysParis's tune, effects
Finale$8000two bitmapsnone

Every playable section reads the joystick in port 2 and nothing else. Each stops the timer that makes the computer scan its keyboard, so the keys do nothing in play; they are read only at the code prompts. The intro and the three sections leave the operating system's ROM switched in and point its interrupt vector at their own routine.

02 · The codes

A section played without its code can never be won

City Hall, the mine and the ending start with PLEASE ENTER CODE. RETURN on its own lets the player in anyway, but the choice is remembered, and it decides how the section ends.

The prompt's check, the same routine in all three programs (City Hall $1088, the mine $5707, the finale $804C): the first five characters are compared, and what comes after them is ignored.

The check stores its answer at the same address in each program, $1BA0: 1 for the right code, 0 for RETURN. A wrong code is simply asked for again, as often as the player likes. The value is read once, at the very end.

SectionWith the codeWith RETURN
City Hallreaching the exit with Stacey shows DB4CT ($7096)reaching the exit starts a new game
The minethe right digits show ILVCT ($25F2)the bomb goes off, whatever the digits
Finalethe ending playsthe prompt asks again

Every code is fixed text in the program that shows it: CCPHJ in Paris's telex, DB4CT in City Hall's end screen, ILVCT in the mine's. Nothing in them depends on how the section was played. There is no score anywhere in the game.

03 · Paris

Secret: Paris starts the chase by resetting the computer

Fire on Paris's instruction page does not call the game. It jumps to the operating system's own reset routine ($4FBB). A reset checks the memory at $8004 for the letters CBM80, the signature a cartridge carries, and if it finds them it starts the cartridge instead of BASIC. Paris keeps a cartridge header of its own at $8000, pointing at the chase ($5A00). So the reset sets up the machine from scratch and then hands straight back to the game.

The same trick makes RESTORE useful: the part points the RESTORE key's interrupt at its own start, so pressing it brings the instruction page back ($43B0).

04 · Shared code

The same routines at the same addresses in different sections

Compared byte for byte in the unpacked programs, these are identical.

WhatWhere
The music driverintro and City Hall, $C621-$C7FE
The Bond theme's notesintro and City Hall, from $E000
The second tune's notesParis and the mine, $E000-$FFFF
Reading the joystickCity Hall $4700, the mine $17A0
The clockParis $4170, City Hall $6E40
The "OK" soundCity Hall $6B50, the mine $3B7D
The code prompt's checkCity Hall, the mine and the finale, apart from the addresses it names
The mine's end screen with ILVCTthe mine $0A00, and unused in City Hall at the same address