1987 · Domark

The Living Daylights: discoveries

This minisite was contributed by 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/the-living-daylights with me to Gold.

Things in the code that a player never sees: a pause that cannot happen, music and sounds nothing plays, and scraps of the programmer's own source text left in the file.

01 · A pause that never happens

The comparison that skips level 8's pause

Before each level, a screen shows its number, a picture of the place, its name, and the lives left ($26E5). At its end the routine was evidently meant to wait a little longer before one level. It loads the level number, which the game counts from 0, and compares it with 7, the eighth level, Whittaker's House; if the level is 7, it compares the same number again with 4, and only waits if that matches too ($2734). The number cannot be both 7 and 4, so the wait at $273F never runs.

02 · A tune nobody hears

Tune 4

The table of tunes at $A700 has five entries, and the game calls the routine that starts a tune from five places, with tunes 0 to 3 (Music). Nothing asks for tune 4. It is short, 31 frames, a little over half a second, and the Music tab plays it. Two of the 17 sound effects, numbers 1 and 9, are never played either.

03 · Scraps of source code

The programmer's notes, left in the file

An assembler turns a programmer's source text into the bytes of a program, and the space it does not fill keeps whatever was in memory before. Three such scraps survive in this game:

WhereWhat the bytes sayWhat it is
$3FCFLDA SEED, ;NEW.SEED, RTS, BEQ GET.RANDOM.SE…Lines of the source text, right after the end of the main program: a routine that makes random numbers
$77D4SP5COL, SP6COL, SP7COL, SID, SUS.REL1Entries of the assembler's table of names, right after the code for drawing the scenery: the colours of sprites 5 to 7, and the sound chip
$2378BALLOON.ORText inside The Mansion's list of craters, which starts empty and is written over as the helicopter bombs

The game has older leftovers too. The ten-entry tables that say where each screen unpacks to have more bytes after their tenth entry, which nothing reads ($115F), and after the level names the words "TOP SCORE" are spelt out, from an earlier build's title ($3BEE).

04 · Two slips in the sound driver

A counter that changes nothing, and a command that sets too much

The sound routine the game calls each frame counts down a frame counter at $A241, which looks meant to play the music on some frames and not others. Both outcomes of the test play it, so every frame plays ($A13C).

Command $86 in a pattern makes a note step down by one each tick, and command $87 makes it step up. The two share their code: $87 sets the flags it needs and falls into the store, and $86 jumps into the middle of it at $A3A2. At that point the register still holds the high byte of the jump's address, $A3, so $86 stores $AB as the voice's flags, turning on more effects than the step ($A39A).

05 · What the guides said

Two things the code does differently from a guide

MI6-HQ's guide to the game says4 that tripping over an obstacle leaves Bond helpless for about three seconds, and that a gadget that is not a weapon leaves him with the Walther PPK. The code says otherwise. A trip is a nine-frame roll and then 60 frames on the ground, a little over a second ($3367). A gadget that does not kill stays in Bond's hand as his second weapon like any other; only after a single-use weapon is spent does the game put the Walther PPK back in his hand and stop him switching ($2C3E).

06 · RESTORE

A key that does nothing

On most C64 programs the RESTORE key causes an interrupt that can stop or reset them. This game points that interrupt at the last byte of its own raster interrupt routine, a bare return ($3B56), so pressing RESTORE has no effect at all.

07 · The American disk

The same game under other names

Melbourne House's disk for American machines holds the game in files called BOND, LOCD, GR, DE, LAST, HID, COLOR, and PIC, which load at the same addresses as the British disk's files and are the same length, or nearly. Two are clearly different: DE is 79 bytes shorter than TLD3, which holds the top 8 KB of memory, and HID shares only 2,289 of its 11,264 bytes with TLD5, which holds the rest of the sound driver and most of the packed screens. What those differences change has not been worked out, and the pages on this site describe the British disk (the copy studied).