Loading listing…
1985 · Domark
Every routine, table and variable the game uses, with the names and descriptions given to them. Click an operand to follow it; the counter beside a label lists what refers to it. The reference below the fold is rendered from the game's facts file.
This game is in 5 parts, and the same addresses hold something else in each. Each part has a listing of its own.
File 2 of the copy studied. Every fact names the routine or table it comes from, in this part's listing.
| Range | What |
|---|---|
$0800-$0FFF | not the game's: an earlier crack's BASIC line (SYS 2067, "MAGIC") and depacker, which ends by jumping to $43B0, and the tail of its packed data; the game reuses $0D09-$0E36 as the 3D view's buffer |
$1000-$1FA2 | play_speech and three speech samples, at $1090, $1225 and $190A, each opening with its length |
$2000-$2BFF | sprites: the car in eight headings ($80-$87), the police car ($88-$8F), May Day's parachute ($90-$97), the steering-wheel halves ($A0-$A3), the bullet ($AC), a shot police car blinking ($AD, $AE) |
$3000-$37FF | the character set of the cockpit and the text |
$3800-$3FFF | the map's multicolour character set; $3C00-$3FFF repeats $3800-$3BFF |
$4000-$5FFF | the code |
$5500-$577F | the instruction page, 16 lines of 40 screen codes in the game's own alphabet |
$6000-$67FF, $7000-$741F | the 3D view's column graphics |
$6800-$6FFF | object templates (copied to the live table at $6900) and the 3D view's tables |
$7A40-$7BC7 | the theme tune's player |
$8000-$8008 | a cartridge header: cold start $5A00, warm start $6015, "CBM80" |
$8028-$81B7 | the telex shown on success, 10 lines of 40 |
$8334-$83FF | start values for the variables $0334-$03FF |
$8B28-$92F7 | the cockpit picture: 1000 screen codes, then 1000 colours |
$92F8-$CFFF | the town map, 124 rows of 126 cells |
$E000-$FFFF | the tune's notes, in the RAM under the KERNAL (the same bytes as the mine's) |
part_entry ($43B0) points the BRK and NMI vectors at itself, so RESTORE brings back the instruction page, and shows it (title_page, $4F30). Up and down on the stick choose the sound: $02E0 is 1 for the tune only, 2 for effects only, 3 for both (the start). Bit 0 turns on the music, bit 1 the effects and the locator's beep.JMP $FCE2, the KERNAL's own reset ($4FBB). The reset finds the cartridge signature "CBM80" at $8004 and jumps through $8000 to game_start ($5A00), as it would into a cartridge.main_loop, $5A30) runs free of the raster: it updates the world every pass, speed and fire every 16th pass, steering every 32nd. The interrupt (game_irq, $5026) splits the screen:| Line | What changes | |---|---| | $8B/$8D | the map's band: character set $3800, fine scroll | | $9A | the map's colours; collision interrupts on | | $FB | the cockpit: character set $3000; the per-frame work runs here |
$0340, from 1 (fastest) to $3F; the car moves two pixels every delay/4 + 1 frames (car_move_tick, $5DA0). Pulling back past the slowest speed changes gear: $03A4 is 0 forward, 8 reverse ($5B59-$5B8F).$03A0, 0 up, then clockwise). Holding the stick to one side turns to the next straight heading and stops there ($5AE0; checked in the simulator: holding right from heading 0 gives 0, 1, 2, 2).$15 is the handbrake turn, four steps anticlockwise ($5B9B); otherwise fire shoots one bullet along the heading (fire_bullet, $4570).car_crash, $51A2): the gear flips so the car bounces back, the delay grows by 3, damage by 1, and $0346 locks the stick until the car next moves (scroll_map clears it at $5CB2). $0346 also starts at 1 at every start (its template byte $8346).$03A1) runs from 0 to 39; at 40 the chase is lost (add_damage, $49A0).$01FA, $01FA) and circles outward until her radius reaches a limit, then heads for one of eight landing points, chosen with the SID's noise ($4F00, tables $4FC0-$4FE7, mayday_update at $5200).altimeter_tick, $5315). Below 060 a catch is possible ($02E1); at 000 the chase is lost ($0313 = $40).$02E1 is set ($5142-$514F, $0313 = $80).mayday_distance, $4850), flashing the lamp at colour RAM $D803 (locator_beep, $4A50).$6860).$12-$19) a police car takes its heading from the cell ($4C9D), and when the player's car leaves a junction the game writes the way it went into that cell ($4E80-$4E95). The police follow the player's route.$03A2 ($4EA0); at 20 a roadblock appears at one of 32 sites, chosen by the frame counter (place_roadblock, $4900), and the counter drops to 18. The police start moving once the counter is 1 or more. Driving into a roadblock clears it and adds 1 damage (roadblock_check, $4940).build_3d_view, $4600, tables at $6D00) and copied to the screen in the interrupt (copy_3d_view, $47FC).$5D52).$8390) and counts one "second" every 60 frames, 1.2 s on PAL (update_clock, $4170).$01 = 0 ($7B73); its notes step every third and then every second frame (music_tick, $7AAB).play_speech ($1000) plays one bit at a time by switching the SID's volume between 0 and 15, with interrupts off.mission_complete ($5800) plays the speech at $1225 and types the telex. Its line at $8140 reads "CCPHJ.....STOP", after "YOUR CODE FOR CITY HALL IS.....": fixed text, the code City Hall checks. The part then loops at $5879.$190A when the altimeter reached 000, and $1090 then $190A when the damage was full (speak_result, $4BA0).$1225 "Well done, 007", $190A "You failed, Bond", $1090 "Damn it".$DC00 is read, and both CIAs' timer A is stopped, so the KERNAL never scans the keys.$436F reads an object's "reset from template" flag with the sprite number where the object's index was meant.$4A50 compares a colour RAM read with #$04 without masking its top four bits, which are undefined on a real C64.$02FF is tested ($502E, $5DA0) and never set.patch_map ($4140) rewrites two short stretches of the map at every start; why is not known.Current truth for this game. The workflow lives in kit/skills/; how this understanding developed lives in agent-history.md. Every fact names the routine or table it comes from. Unless marked live, a fact comes from reading the code in the snapshots named in orientation.md.
The game is five programs, and each has its own facts, listing and symbols under parts/<id>/: parts/intro/facts.md, parts/paris/facts.md, parts/city-hall/facts.md, parts/mine/facts.md, parts/finale/facts.md. An address is always an address in the part named with it. This file holds what spans the parts.
Five programs, loaded one at a time from a menu, each unpacked over the whole of memory and started at its own entry (orientation.md):
| Part | Entry | Interrupt in play | Screen | Sound |
|---|---|---|---|---|
| intro | $8020 | $CC00 | bitmap, banks 1 and 2 | the Bond theme, speech |
| Paris | $43B0, then $5A00 | $5026 | $0400 | the theme, effects, speech |
| City Hall | $1000 | $4022 | $0400 | the intro's tune, effects |
| mine | $5660 | $1022 | $4000 | Paris's tune, effects |
| finale | $8000 | the KERNAL's | bitmap $2000, $6000 | none |
Nothing is loaded once a part runs, and no part loads the next: the player goes back to the menu for each.
The three later parts start at a KERNAL "PLEASE ENTER CODE" prompt with the same routine (read_code: City Hall $1088, mine $5707, finale $804C): five characters through CHRIN, compared with a fixed string. A match stores 1 in $1BA0; RETURN before five characters stores 0 and plays on without the code (the finale goes back to its prompt instead); a wrong code is read again, with no limit on tries.
| Given by | Where it is shown | Code | Checked by |
|---|---|---|---|
| Paris, on a catch | the telex, Paris $8140 | CCPHJ | City Hall $10D8 |
| City Hall, on escape | mission_complete, City Hall $1334 | DB4CT | mine $5757 |
| the mine, on defusing | mission_complete, mine $0AFE | ILVCT | finale $809C |
$1BA0 is the same address in all three parts, and a part reads it once, at its end:$7096): with the code, reaching room 76 with Stacey shows DB4CT; without it the game starts again ($8600).$25F2): with the code, the right bomb digits show ILVCT; without it the bomb goes off, whatever the digits (game_over, $25D0).parts/city-hall/facts.md, parts/mine/facts.md). The finale compared only five characters: ILVCTX was accepted.Bytes identical at the same addresses, compared in the unpacked images:
| What | Where |
|---|---|
| the three-voice music driver | intro and City Hall $C621-$C7FE |
| the Bond theme's notes | intro $E000, City Hall $E000 (and intro $8500, the copy it moves there) |
| the second tune's notes | Paris and mine $E000-$FFFF |
read_joystick | City Hall $4700, mine $17A0 |
tick_clock | Paris $4170, City Hall $6E40 |
| the "OK" sound | City Hall $6B50, mine $3B7D |
read_code | City Hall $1088, mine $5707, finale $804C, apart from the addresses they name |
mission_complete and its text with ILVCT | mine $0A00-$0B04, and the same bytes in City Hall, where nothing calls them |
All four playable parts read the joystick in port 2 only ($DC00) and stop CIA 1's timer A, so the KERNAL never scans the keyboard during play; the keyboard is used only at the code prompts.
Each part carries leftovers of earlier work on the game, none of which runs:
$8020 onwards, overwritten by a 14-byte patch (parts/intro/facts.md).$0800.$967B), an older end screen ("WEBL DONE 007 YOUR CODE IS 111122", $7E5A), and the mine's end screen at $0A00.$0B04-$0FFF).Whether the code prompts and end screens are the original game's or the crackers' is open. For the crackers: the older prompt and end screen left in City Hall, and the mine's prompt placed in character-set glyphs the mine's tiles do not use. Against: the memos, which are plainly the game's, also print through the KERNAL. The published game is documented with the three codes (C64-Wiki, features.md).
| Test | Part | Result |
|---|---|---|
| each code at its prompt; a wrong code; RETURN | City Hall, mine, finale | as above |
| four intro boots, start moved a tenth of a second each time | intro | the credits stalled in one (parts/intro/facts.md) |
| Bond's room set burning, with and without CCPHJ | City Hall | the DB4CT screen; a new game |
end_check run with set digits, with and without DB4CT | mine | ILVCT; game_over |
| RESTORE after the ending | finale | the prompt again, blind |
| holding fire for 1.2 s on Paris's instruction page | Paris | the chase started normally; a stuck start seen once earlier was not reproduced |
Pokes that change the game within its own parameters. Each one names the variable it changes and whether it has been tested live. Untested pokes are labelled as candidates. Addresses are in the part named.
| Effect | Poke | Status |
|---|---|---|
| Play City Hall or the mine without the previous code | press RETURN at "PLEASE ENTER CODE" | live |
| Codes: City Hall CCPHJ, the mine DB4CT, the finale ILVCT | type at the prompt | live |
| City Hall: end the part at once (with CCPHJ typed) | set byte 12 of Bond's room record: POKE the address in $3F/$40 plus 12 with 1 | live |
| Mine: the bomb's combination | numbered items 6, 7, 1, 3, 4 ($26F0) | live, by storing the digits |
| Mine: stop the clock | $1B80 = 1 (the PAUSE flag) | candidate |
| Paris: repair the car | $03A1 = 0 (damage, 40 loses) | candidate |
| City Hall: refill Bond's energy figure | $1B5B = 42 (the gauge never kills) | candidate |