{
 "schema": 1,
 "platform": "c64",
 "game": "robocop",
 "part": "resident",
 "build": "",
 "source": "regenerator2000 live",
 "regions": {
  "exclude": [
   [
    256,
    511,
    "stack"
   ],
   [
    53248,
    57343,
    "I/O and colour RAM"
   ],
   [
    0,
    271,
    "zero page and the bottom of the stack: the machine's and the game's working values, rewritten as it runs"
   ],
   [
    491,
    511,
    "the stack in use, where the boot file's $02 bytes have already been pushed over"
   ],
   [
    518,
    2559,
    "BASIC's and the KERNAL's work area, the game's variables at $0600-$07FF and the copy of the level loader at $0400-$06FF, all written as the game runs; $0800-$09FF is never written and holds RAM's power-on pattern"
   ],
   [
    2803,
    3647,
    "the fast loader's block buffer at $0B00, holding the last block it received, and memory nothing loads, with RAM's power-on pattern"
   ],
   [
    16384,
    20479,
    "the two play screens and the play area's character set, which LOAD1 brings in as they stand at the start of stage one and every stage then rewrites"
   ],
   [
    65528,
    65535,
    "after LOAD1's last byte: the interrupt vectors, which each level sets as it starts"
   ],
   [
    3840,
    16383,
    "3 parts: Level three: stages 8 and 9, Level one: stages 1 to 3, Level two: stages 4 to 7"
   ],
   [
    20480,
    48075,
    "3 parts: Level three: stages 8 and 9, Level one: stages 1 to 3, Level two: stages 4 to 7"
   ],
   [
    53248,
    64999,
    "3 parts: Level three: stages 8 and 9, Level one: stages 1 to 3, Level two: stages 4 to 7"
   ]
  ],
  "extra": [],
  "edges": [
   0,
   256,
   512,
   1024,
   2048,
   4096,
   16384,
   32768,
   40960,
   49152,
   53248,
   57344
  ],
  "elsewhere": [
   [
    3840,
    16383,
    "3 parts: Level three: stages 8 and 9, Level one: stages 1 to 3, Level two: stages 4 to 7"
   ],
   [
    20480,
    48075,
    "3 parts: Level three: stages 8 and 9, Level one: stages 1 to 3, Level two: stages 4 to 7"
   ],
   [
    53248,
    64999,
    "3 parts: Level three: stages 8 and 9, Level one: stages 1 to 3, Level two: stages 4 to 7"
   ]
  ]
 },
 "blocks": [
  {
   "start": 0,
   "end": 271,
   "type": "Undefined"
  },
  {
   "start": 272,
   "end": 295,
   "type": "Byte"
  },
  {
   "start": 296,
   "end": 374,
   "type": "Code"
  },
  {
   "start": 375,
   "end": 490,
   "type": "Byte"
  },
  {
   "start": 491,
   "end": 511,
   "type": "Undefined"
  },
  {
   "start": 512,
   "end": 514,
   "type": "Byte"
  },
  {
   "start": 515,
   "end": 517,
   "type": "Code"
  },
  {
   "start": 518,
   "end": 2559,
   "type": "Undefined"
  },
  {
   "start": 2560,
   "end": 2567,
   "type": "Byte"
  },
  {
   "start": 2568,
   "end": 2802,
   "type": "Code"
  },
  {
   "start": 2803,
   "end": 3647,
   "type": "Undefined"
  },
  {
   "start": 3648,
   "end": 3839,
   "type": "Byte"
  },
  {
   "start": 16384,
   "end": 20479,
   "type": "Undefined"
  },
  {
   "start": 48076,
   "end": 52559,
   "type": "Byte"
  },
  {
   "start": 52560,
   "end": 52617,
   "type": "Code"
  },
  {
   "start": 52618,
   "end": 53247,
   "type": "Byte"
  },
  {
   "start": 65000,
   "end": 65527,
   "type": "Byte"
  },
  {
   "start": 65528,
   "end": 65535,
   "type": "Undefined"
  }
 ],
 "symbols": [
  {
   "address": 272,
   "name": "boot_basic_line",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 296,
   "name": "boot_start",
   "type": "Jump",
   "kind": "user"
  },
  {
   "address": 299,
   "name": "b_012B",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 361,
   "name": "boot_setname",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 375,
   "name": "boot_name_load1",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 391,
   "name": "boot_name_fast",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 395,
   "name": "boot_stack_fill",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 512,
   "name": "boot_tail",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 515,
   "name": "boot_jump",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2560,
   "name": "fast_drive_cmd",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 2565,
   "name": "fast_not_present",
   "type": "Branch",
   "kind": "user"
  },
  {
   "address": 2568,
   "name": "fast_load",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2586,
   "name": "b_0A1A",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2638,
   "name": "b_0A4E",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2658,
   "name": "fast_load_addr",
   "type": "Branch",
   "kind": "user"
  },
  {
   "address": 2662,
   "name": "fast_get_block",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2667,
   "name": "fast_get_byte",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2674,
   "name": "fast_byte_loop",
   "type": "Jump",
   "kind": "user"
  },
  {
   "address": 2681,
   "name": "b_0A79",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2685,
   "name": "fast_badline_operand",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 2692,
   "name": "b_0A84",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2719,
   "name": "fast_bank_operand",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 2725,
   "name": "fast_block_store",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 2732,
   "name": "fast_block_copy",
   "type": "Branch",
   "kind": "user"
  },
  {
   "address": 2739,
   "name": "b_0AB3",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2768,
   "name": "fast_load_blank",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2773,
   "name": "b_0AD5",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2781,
   "name": "fast_next_block",
   "type": "Branch",
   "kind": "user"
  },
  {
   "address": 2802,
   "name": "r_0AF2",
   "type": "Return",
   "kind": "auto"
  },
  {
   "address": 2815,
   "name": "f_0AFF",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 2816,
   "name": "f_0B00",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 3648,
   "name": "high_scores",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 3792,
   "name": "leftover_0ed0",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 48076,
   "name": "leftover_tune",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 48952,
   "name": "leftover_tune_instruments",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 49152,
   "name": "panel_screen",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 50168,
   "name": "panel_sprite_ptrs",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 50176,
   "name": "stage7_tiles",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 51200,
   "name": "stage7_tiles_64",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52224,
   "name": "stage7_tiles_128",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52458,
   "name": "a_CCEA",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 52464,
   "name": "stage7_tiles_spare",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52489,
   "name": "b_CD09",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52560,
   "name": "leftover_hex_parse",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52562,
   "name": "b_CD52",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52564,
   "name": "b_CD54",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52586,
   "name": "b_CD6A",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52599,
   "name": "leftover_space_back",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52618,
   "name": "leftover_hex_digits",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52623,
   "name": "leftover_hex_value",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 52624,
   "name": "leftover_hex_value_hi",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 52736,
   "name": "leftover_ram_pattern_3",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 65000,
   "name": "leftover_fde8",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 65424,
   "name": "KERNAL_SETMSG",
   "type": "Predefined",
   "kind": "system"
  },
  {
   "address": 65427,
   "name": "KERNAL_SECOND",
   "type": "Predefined",
   "kind": "system"
  },
  {
   "address": 65448,
   "name": "KERNAL_CIOUT",
   "type": "Predefined",
   "kind": "system"
  },
  {
   "address": 65457,
   "name": "KERNAL_LISTEN",
   "type": "Predefined",
   "kind": "system"
  },
  {
   "address": 65466,
   "name": "KERNAL_SETLFS",
   "type": "Predefined",
   "kind": "system"
  },
  {
   "address": 65469,
   "name": "KERNAL_SETNAM",
   "type": "Predefined",
   "kind": "system"
  },
  {
   "address": 65490,
   "name": "KERNAL_CHROUT",
   "type": "Predefined",
   "kind": "system"
  },
  {
   "address": 65493,
   "name": "KERNAL_LOAD",
   "type": "Predefined",
   "kind": "system"
  }
 ],
 "comments": [
  {
   "address": 272,
   "type": "line",
   "text": "The boot file ROBOCOP loads here, at $0110, over the bottom of the stack, and starts with a BASIC line no one runs: 10 X=PEEK(186):LOAD\"*\",X,1, the usual way to load a program to its own address from the drive it came from"
  },
  {
   "address": 296,
   "type": "line",
   "text": "The boot file's code, reached through $0203 when the KERNAL's LOAD returns. Waits for raster line 11 and blanks the screen, sets a light blue border and blue background, turns KERNAL messages off, clears the screen, loads FAST from the same drive ($0169 sets the name) and calls it at $7000, then loads LOAD1 at its own address with the fast loader that FAST put in place, and jumps to $8000 to start the game"
  },
  {
   "address": 361,
   "type": "line",
   "text": "Sets the file name (length in A, address $01xx with the low byte in X) and the file: number $50, the drive the boot file came from ($BA), secondary address 1 so the file loads to its own address"
  },
  {
   "address": 375,
   "type": "line",
   "text": "File name LOAD1, padded with shifted spaces to 15 characters"
  },
  {
   "address": 391,
   "type": "line",
   "text": "File name FAS*: the wildcard finds FAST"
  },
  {
   "address": 395,
   "type": "line",
   "text": "The rest of the boot file: $02 bytes over the stack. When LOAD returns, the RTS pulls $02 $02 from here and goes to $0203, so the boot file starts itself without a RUN"
  },
  {
   "address": 512,
   "type": "line",
   "text": "The boot file's last six bytes, over the start of BASIC's input buffer: three more $02 bytes, then the JMP that the stack's return address lands on"
  },
  {
   "address": 515,
   "type": "line",
   "text": "Jumps to the boot code at $0128"
  },
  {
   "address": 2560,
   "type": "line",
   "text": "The fast loader's computer side, put here by FAST. The five bytes M-E $62 $01: the disk drive's memory-execute command, which starts the drive half of the loader at drive address $0162"
  },
  {
   "address": 2565,
   "type": "line",
   "text": "Jumps to the KERNAL's error entry at $F707, which reports error 5, DEVICE NOT PRESENT; $0A18 comes here when the drive does not answer"
  },
  {
   "address": 2568,
   "type": "line",
   "text": "The LOAD vector at $0330 points here. Opens the drive's command channel and sends it M-E ($0A1A, five bytes through $FFA8) to start the drive's half of the loader. Patches $0A7D from the screen's vertical scroll ($D011), so the byte loop can tell which raster lines are bad lines, keeps the VIC bank bits of $DD00 in $94, turns sprites off while it loads, waits for the drive, and reads the file's load address"
  },
  {
   "address": 2658,
   "type": "line",
   "text": "Keeps the load address in $AE/$AF: the file's own when the secondary address is not 0, otherwise the one in X and Y"
  },
  {
   "address": 2662,
   "type": "line",
   "text": "Puts $99 (STA $0B00,Y) at $0AA5, so the loop below fills the block buffer. The BIT at $0A6A hides an LDA #$60 for the entry at $0A6B"
  },
  {
   "address": 2667,
   "type": "line",
   "text": "Puts $60 (RTS) at $0AA5 instead, so the same loop returns after one byte, in A"
  },
  {
   "address": 2674,
   "type": "line",
   "text": "Each byte: when the drive drops its line (bit 6 of $DD00) the block is over ($0AAC); otherwise waits for a raster line clear of the bad lines, where the VIC-II would steal cycles, signals the drive, and reads four pairs of bits from the clock and data lines of $DD00 on a fixed beat"
  },
  {
   "address": 2685,
   "type": "line",
   "text": "This SBC's operand is patched at $0A2F from the vertical scroll, so the test skips the raster lines where the VIC-II steals cycles"
  },
  {
   "address": 2719,
   "type": "line",
   "text": "This EOR's operand is patched at $0A41 from the VIC bank bits of $DD00, so they do not spoil the bits read"
  },
  {
   "address": 2725,
   "type": "line",
   "text": "Stores the byte in the block buffer at $0B00, or returns it (see $0A66 and $0A6B)"
  },
  {
   "address": 2732,
   "type": "line",
   "text": "A block is in: with the BASIC and KERNAL ROMs and the I/O chips switched out ($01 = $24), copies it from the buffer to its place in memory, so a file can load under them, then switches back ($01 = $27) and moves the load address on"
  },
  {
   "address": 2768,
   "type": "line",
   "text": "When the load reaches $DB00, blanks the screen: clears bit 4 of $D011 on a raster line that matches"
  },
  {
   "address": 2781,
   "type": "line",
   "text": "Waits for the drive; bit 7 of $DD00 says whether another block follows ($0A72). At the end puts the sprites back, sets the status $90 to $40 (end of file) and returns with carry clear: no error"
  },
  {
   "address": 3648,
   "type": "line",
   "text": "The high-score table, eight entries of 18 bytes: three bytes of score in decimal digits, highest first (00 40 00 is 4,000), and 15 screen-code letters. LOAD1 brings it in and no level's files load over it, so it lasts until the machine is switched off; level three compares and inserts scores at $E93E-$E9CD. The names shipped with the game: ALIENATION, ANGST, MISERY, FRUSTRATION, TORMENT, DESPAIR, a row of dots, and HAVE A NICE DAY, all at 4,000 points"
  },
  {
   "address": 3792,
   "type": "line",
   "text": "48 bytes after the table, inside LOAD1, that nothing reads"
  },
  {
   "address": 48076,
   "type": "line",
   "text": "A tune that no code plays, left in LOAD1 after the bytes of level one's own: the end of its patterns, which run on from the leftovers at $B800, in the layout of the music driver's patterns, with pattern pointers that name these very addresses ($BF26, $BF2F), so it was built to sit here"
  },
  {
   "address": 48952,
   "type": "line",
   "text": "From here to $BFFF the leftover changes to rows of eight bytes, probably the leftover tune's instruments; nothing reads them either"
  },
  {
   "address": 49152,
   "type": "line",
   "text": "The status panel's screen in VIC bank 3, as LOAD1 brings it in: the message line ($C000-$C027), SCORE with its six digits at $C07F, the ROBOCOP logo, POWER with its bar of six characters at $C098, and the clock at $C0B2-$C0B5. The interrupt at the bottom of the screen points the VIC-II here (screen $C000, characters $D000) for the top of the next frame"
  },
  {
   "address": 50168,
   "type": "line",
   "text": "The panel screen's eight sprite pointers, set to 5 by level one ($E08B)"
  },
  {
   "address": 50176,
   "type": "line",
   "text": "Stage seven's tiles, used in level two: 143 of 4 by 4 characters, 16 bytes each, row by row. Level two's files do not hold them: they come with LOAD1 and wait here through level one, and level two's table at $E18B gives $C4 as stage seven's tile set. On the second disk image LOAD1 has other bytes here, and stage seven draws its walls from them"
  },
  {
   "address": 51200,
   "type": "line",
   "text": "Stage seven's tiles 64 to 127"
  },
  {
   "address": 52224,
   "type": "line",
   "text": "Stage seven's tiles 128 to 142, to $CCEF"
  },
  {
   "address": 52458,
   "type": "line",
   "text": "The leftover code at $CD84 writes 1 here, inside what is now a tile"
  },
  {
   "address": 52464,
   "type": "line",
   "text": "Six more tiles (143 to 148) that stage seven's map never uses"
  },
  {
   "address": 52560,
   "type": "line",
   "text": "Code that nothing calls: turns four ASCII hex digits at $CD8A into a 16-bit number at $CD8F/$CD90, a piece of a development tool left in LOAD1"
  },
  {
   "address": 52599,
   "type": "line",
   "text": "More leftover code: writes a space at $06FE+Y and steps Y back, then jumps to $CD09, where tile bytes now lie, so it belongs to an older layout of memory"
  },
  {
   "address": 52618,
   "type": "line",
   "text": "The four ASCII hex digits the leftover code at $CD50 reads"
  },
  {
   "address": 52623,
   "type": "line",
   "text": "Where the leftover code at $CD50 builds its number: the low byte here, the high byte at $CD90"
  },
  {
   "address": 52624,
   "type": "line",
   "text": "The high byte of that number. From $CD91 to $CFFF the file holds what was in the authors' machine's memory: the stripes of $00 and $FF that the C64's RAM holds at power-on, with a few bits changed"
  },
  {
   "address": 52688,
   "type": "line",
   "text": "More of the power-on pattern"
  },
  {
   "address": 52736,
   "type": "line",
   "text": "More of the power-on pattern, to $CFFF"
  },
  {
   "address": 65000,
   "type": "line",
   "text": "The rest of LOAD1 after level one's own bytes, to $FFF7: shapes laid out three bytes to a row like sprites, in the bank-3 sprite frames $F7 to $FE, which no sprite pointer ever names"
  }
 ]
}