{
 "schema": 1,
 "platform": "c64",
 "game": "north-and-south",
 "part": "resident",
 "build": "PAL cassette, four sides, Cyberload fast loader; the original release as the Ultimate Tape Archive V4.0 has it (entry 7562)",
 "source": "regenerator2000 live",
 "regions": {
  "exclude": [
   [
    256,
    511,
    "stack"
   ],
   [
    53248,
    57343,
    "I/O and colour RAM"
   ],
   [
    1024,
    2047,
    "runtime: the screen of the text modes (the loading banner, the tape prompts, the year's text), written by the boot, $09A9, $092E and each year's file"
   ],
   [
    0,
    255,
    "runtime: the zero page, the processor port at $00/$01 and each part's own pointers and counters, set before they are read: the loader's ($93-$BC), the unpacker's ($10-$17), the scroll's ($04, $05, $10, $11, $20-$23), the music drivers' ($F0-$FF)"
   ],
   [
    65530,
    65535,
    "runtime: the NMI, reset and IRQ vectors, which each part and the loader set for themselves"
   ],
   [
    3072,
    53246,
    "7 parts: The strategic map, The menu, The title and others"
   ],
   [
    57344,
    65529,
    "2 parts: The strategic map, The menu"
   ]
  ],
  "extra": [],
  "edges": [
   0,
   256,
   512,
   1024,
   2048,
   4096,
   16384,
   32768,
   40960,
   49152,
   53248,
   57344
  ],
  "elsewhere": [
   [
    3072,
    53246,
    "7 parts: The strategic map, The menu, The title and others"
   ],
   [
    57344,
    65529,
    "2 parts: The strategic map, The menu"
   ]
  ]
 },
 "blocks": [
  {
   "start": 0,
   "end": 678,
   "type": "Undefined"
  },
  {
   "start": 679,
   "end": 893,
   "type": "Byte"
  },
  {
   "start": 894,
   "end": 923,
   "type": "Undefined"
  },
  {
   "start": 924,
   "end": 1021,
   "type": "Byte"
  },
  {
   "start": 1022,
   "end": 2047,
   "type": "Undefined"
  },
  {
   "start": 2048,
   "end": 2250,
   "type": "Code"
  },
  {
   "start": 2251,
   "end": 2349,
   "type": "Undefined"
  },
  {
   "start": 2350,
   "end": 2432,
   "type": "Code"
  },
  {
   "start": 2433,
   "end": 2472,
   "type": "Undefined"
  },
  {
   "start": 2473,
   "end": 2582,
   "type": "Code"
  },
  {
   "start": 2583,
   "end": 2658,
   "type": "Byte"
  },
  {
   "start": 2659,
   "end": 2759,
   "type": "Code"
  },
  {
   "start": 2760,
   "end": 2762,
   "type": "Undefined"
  },
  {
   "start": 2763,
   "end": 3071,
   "type": "Code"
  },
  {
   "start": 53247,
   "end": 57343,
   "type": "Undefined"
  },
  {
   "start": 65530,
   "end": 65534,
   "type": "Undefined"
  },
  {
   "start": 65535,
   "end": 65535,
   "type": "Code"
  }
 ],
 "symbols": [
  {
   "address": 0,
   "name": "cpu_port_ddr",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 1,
   "name": "zpa_01",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 144,
   "name": "zpa_90",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 147,
   "name": "zpa_93",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 149,
   "name": "zpa_95",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 155,
   "name": "zpa_9B",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 156,
   "name": "zpa_9C",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 172,
   "name": "zpa_AC",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 173,
   "name": "zpa_AD",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 174,
   "name": "zpa_AE",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 175,
   "name": "zpa_AF",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 176,
   "name": "zpa_B0",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 177,
   "name": "zpa_B1",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 183,
   "name": "zpa_B7",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 187,
   "name": "zpa_BB",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 188,
   "name": "zpa_BC",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 192,
   "name": "zpa_C0",
   "type": "ZeroPageAbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 679,
   "name": "boot_stage1",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 828,
   "name": "boot_header",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 894,
   "name": "year_kept",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 895,
   "name": "menu_seen",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 896,
   "name": "level",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 898,
   "name": "cpu_union",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 899,
   "name": "cpu_confed",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 900,
   "name": "opt_indians",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 901,
   "name": "opt_storm",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 902,
   "name": "opt_reinforcements",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 903,
   "name": "opt_arcade",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 904,
   "name": "opt_keyboard",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 905,
   "name": "start_year",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 906,
   "name": "units_inf",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 908,
   "name": "units_cav",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 910,
   "name": "units_cannon",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 912,
   "name": "retreat_to",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 914,
   "name": "fell_back",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 916,
   "name": "side_out",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 918,
   "name": "attacker",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 919,
   "name": "arcade_result",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 920,
   "name": "winner",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 921,
   "name": "months_tens",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 922,
   "name": "months_units",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 923,
   "name": "no_ending",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 924,
   "name": "boot_header_end",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 1020,
   "name": "boot_after",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 1022,
   "name": "p_03FE",
   "type": "Pointer",
   "kind": "auto"
  },
  {
   "address": 1024,
   "name": "f_0400",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 1280,
   "name": "f_0500",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 1536,
   "name": "f_0600",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 1792,
   "name": "f_0700",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 1984,
   "name": "f_07C0",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 2048,
   "name": "boot_entry",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2051,
   "name": "load_file",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2054,
   "name": "script",
   "type": "Jump",
   "kind": "user"
  },
  {
   "address": 2067,
   "name": "j_0813",
   "type": "Jump",
   "kind": "auto"
  },
  {
   "address": 2138,
   "name": "b_085A",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2149,
   "name": "load_by_number",
   "type": "Jump",
   "kind": "user"
  },
  {
   "address": 2152,
   "name": "j_0868",
   "type": "Jump",
   "kind": "auto"
  },
  {
   "address": 2167,
   "name": "b_0877",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2194,
   "name": "b_0892",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2200,
   "name": "quiet_machine",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2251,
   "name": "file_asked",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 2252,
   "name": "file_names",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 2253,
   "name": "f_08CD",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 2280,
   "name": "file_side",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 2294,
   "name": "file_tape",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 2308,
   "name": "file_starts_side",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 2322,
   "name": "file_name_text",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2350,
   "name": "rewind_prompt",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2380,
   "name": "b_094C",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2412,
   "name": "wait_fire",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2422,
   "name": "b_0976",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2433,
   "name": "rewind_text",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 2445,
   "name": "a_098D",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2452,
   "name": "a_0994",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2473,
   "name": "clear_screen",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2475,
   "name": "b_09AB",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2506,
   "name": "text_mode",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2540,
   "name": "year_text",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2542,
   "name": "b_09EE",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2659,
   "name": "fast_load",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 2724,
   "name": "b_0AA4",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2751,
   "name": "r_0ABF",
   "type": "Return",
   "kind": "auto"
  },
  {
   "address": 2752,
   "name": "b_0AC0",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2760,
   "name": "loader_irq_vec",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2761,
   "name": "a_0AC9",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2762,
   "name": "a_0ACA",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2763,
   "name": "loader_irq",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2790,
   "name": "b_0AE6",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2796,
   "name": "a_0AEC",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2819,
   "name": "b_0B03",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2842,
   "name": "a_0B1A",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2847,
   "name": "b_0B1F",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2856,
   "name": "b_0B28",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2861,
   "name": "b_0B2D",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2870,
   "name": "b_0B36",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2905,
   "name": "b_0B59",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2916,
   "name": "b_0B64",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2921,
   "name": "b_0B69",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2958,
   "name": "a_0B8E",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2960,
   "name": "a_0B90",
   "type": "AbsoluteAddress",
   "kind": "auto"
  },
  {
   "address": 2965,
   "name": "b_0B95",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2978,
   "name": "b_0BA2",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2980,
   "name": "j_0BA4",
   "type": "Jump",
   "kind": "auto"
  },
  {
   "address": 2996,
   "name": "b_0BB4",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 2999,
   "name": "j_0BB7",
   "type": "Jump",
   "kind": "auto"
  },
  {
   "address": 3013,
   "name": "b_0BC5",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 3021,
   "name": "b_0BCD",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 3033,
   "name": "b_0BD9",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 3041,
   "name": "j_0BE1",
   "type": "Jump",
   "kind": "auto"
  },
  {
   "address": 3045,
   "name": "b_0BE5",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 3047,
   "name": "b_0BE7",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 3057,
   "name": "b_0BF1",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 55296,
   "name": "f_D800",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 55552,
   "name": "f_D900",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 55808,
   "name": "f_DA00",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 56064,
   "name": "f_DB00",
   "type": "Field",
   "kind": "auto"
  },
  {
   "address": 56256,
   "name": "f_DBC0",
   "type": "Field",
   "kind": "auto"
  }
 ],
 "comments": [
  {
   "address": 679,
   "type": "line",
   "text": "what is left of the tape's first file ($029F-$033A, as its header at $033C says), the boot the KERNAL loads: from $02AC it draws the loading banner, \"CYBERLOAD NOW LOADING NORTH & SOUTH\" (35 screen codes at $02EE) between stripes of colour, decodes the code in the tape header after it by an XOR chain ($02DC), and runs it. It lies over the KERNAL's vectors at $0300-$0333. Nothing runs it again once the game has started."
  },
  {
   "address": 828,
   "type": "line",
   "text": "the KERNAL's cassette buffer as the boot left it: the boot file's header (type 3, start $029F, end $033B, the name \"NORTH & SOUTH\" at $0341) and from $0351 the decoded code that reads the fast loader from tape with CIA 1's timer ($0357); the game's settings at $037E-$039B are written over the rest of it."
  },
  {
   "address": 894,
   "type": "line",
   "text": "the start year the menu chose, kept for redrawing the menu's calendar ($11BB) when the game comes back to the menu."
  },
  {
   "address": 895,
   "type": "line",
   "text": "0 until the menu has run once: then it sets the defaults and makes it 1 ($1878), so later visits keep the settings."
  },
  {
   "address": 896,
   "type": "line",
   "text": "each side's level, 0 to 2, set on the menu: corporal, sergeant, captain, the rank the ending's messages give; the computer's chances in the battle ($9D14 there) and the fort's and train's lengths and guards follow it."
  },
  {
   "address": 897,
   "type": "line",
   "text": "level, continued: the Confederacy's."
  },
  {
   "address": 898,
   "type": "line",
   "text": "1 when the computer plays the Union."
  },
  {
   "address": 899,
   "type": "line",
   "text": "1 when the computer plays the Confederacy."
  },
  {
   "address": 900,
   "type": "line",
   "text": "1 with the Indians and the Mexican on."
  },
  {
   "address": 901,
   "type": "line",
   "text": "1 with the storm on."
  },
  {
   "address": 902,
   "type": "line",
   "text": "1 with the European reinforcements on."
  },
  {
   "address": 903,
   "type": "line",
   "text": "1 for the arcade sequences (battle, fort, train), 0 for the strategic game, which decides them at random."
  },
  {
   "address": 904,
   "type": "line",
   "text": "1 for the keys instead of the joystick, when one person plays."
  },
  {
   "address": 905,
   "type": "line",
   "text": "the start year, 0 to 3 for 1861 to 1864; the map moves it on each December."
  },
  {
   "address": 906,
   "type": "line",
   "text": "the infantry of each side in the battle: the Union's here, the Confederacy's at $038B; the map fills these and reads back what is left."
  },
  {
   "address": 907,
   "type": "line",
   "text": "units_inf, continued: the Confederacy's."
  },
  {
   "address": 908,
   "type": "line",
   "text": "each side's cavalry in the battle."
  },
  {
   "address": 909,
   "type": "line",
   "text": "units_cav, continued: the Confederacy's."
  },
  {
   "address": 910,
   "type": "line",
   "text": "each side's cannons in the battle."
  },
  {
   "address": 911,
   "type": "line",
   "text": "units_cannon, continued: the Confederacy's."
  },
  {
   "address": 912,
   "type": "line",
   "text": "each side's territory to fall back to from the battle, $FF for none."
  },
  {
   "address": 913,
   "type": "line",
   "text": "retreat_to, continued: the Confederacy's."
  },
  {
   "address": 914,
   "type": "line",
   "text": "set for a side that fell back in the battle."
  },
  {
   "address": 915,
   "type": "line",
   "text": "fell_back, continued: the Confederacy's."
  },
  {
   "address": 916,
   "type": "line",
   "text": "$FF for a side that is out of the battle, beaten or gone."
  },
  {
   "address": 917,
   "type": "line",
   "text": "side_out, continued: the Confederacy's."
  },
  {
   "address": 918,
   "type": "line",
   "text": "the side that attacks in the fort or the train (0 the Union, 1 the Confederacy)."
  },
  {
   "address": 919,
   "type": "line",
   "text": "the fort's or the train's result: 1 the attacker won, 0 it lost."
  },
  {
   "address": 920,
   "type": "line",
   "text": "the side that won the war, which the ending reads: 0 the Union, 1 the Confederacy."
  },
  {
   "address": 921,
   "type": "line",
   "text": "the months the war has lasted, tens digit, 0 shown as a space by the ending."
  },
  {
   "address": 922,
   "type": "line",
   "text": "its units digit, counted on each month by the map ($0C7F)."
  },
  {
   "address": 923,
   "type": "line",
   "text": "1 so that the script loads no ending: the map sets it ($1173) when the Commodore key stops a game the computer plays on both sides, and clears it when the war is won ($0CE0)."
  },
  {
   "address": 924,
   "type": "line",
   "text": "the rest of the boot's code in the cassette buffer, after the game's settings, with its subroutines at $03AE (a byte) and $03BF (a bit, timed by CIA 1's timer A)."
  },
  {
   "address": 1020,
   "type": "line",
   "text": "two bytes after the cassette buffer, 0, that nothing reads."
  },
  {
   "address": 2048,
   "type": "line",
   "text": "the game's own start, reached once by the Cyberload boot: jumps over the next vector to the script at $0806."
  },
  {
   "address": 2051,
   "type": "line",
   "text": "the one way any part loads a file: A is the file's number (0 to 13, the table at $0912); jumps to $0865, which shows the tape prompt first when the file starts a side and retries the load until it succeeds."
  },
  {
   "address": 2054,
   "type": "line",
   "text": "the game's top level. Loads file 7 (TP, the title) and calls it at $8000; then for ever: files 0 and 1 (OC and OM, the menu) and the menu at $1000; the start year's file, 9 + the year chosen ($0389, 0 to 3, so T1 to T4); the map's files 3, 2 and 4 (M2, M1, M3); the year's text ($09EC) and the strategic game at $0C00; then, unless $039B is set, file 13 (CS, the ending) at $8000; and last the prompt for tape 1 side 1 before the menu loads again. The screen is cleared ($09A9) between the steps."
  },
  {
   "address": 2062,
   "type": "line",
   "text": "the menu loop's start: clears $037F, then resets the stack to $FF on every pass, so nothing a part left on it survives."
  },
  {
   "address": 2122,
   "type": "line",
   "text": "after the strategic game returns: a $039B of 0 loads the ending, any other value goes straight to the prompt for side 1."
  },
  {
   "address": 2138,
   "type": "line",
   "text": "the end of a game: asks for tape 1 side 1 ($08CB = 0, the prompt at $092E) and loads the menu again."
  },
  {
   "address": 2149,
   "type": "line",
   "text": "stores the file's number in $08CB, quietens the machine ($0898), shows the rewind prompt ($092E) when $0904 marks the file as the first of its side, points $BB/$BC at its two-letter name ($08CC) with the name's length 2 in $B7, and calls the fast loader with mode $41 (load where the file's header says, border flashing). The loader returns carry set on a bad load; the prompt is then shown again and the load retried, for ever."
  },
  {
   "address": 2200,
   "type": "line",
   "text": "before a load or a prompt: interrupts off, the KERNAL and BASIC in ($01 = $37), both CIAs' interrupts and timers stopped and acknowledged, border and background black, sprites off, the raster interrupt off and acknowledged, interrupts on again (the KERNAL's)."
  },
  {
   "address": 2251,
   "type": "line",
   "text": "the number of the file being loaded, written by $0865 (and $085C); read by the loader's caller and the prompt."
  },
  {
   "address": 2252,
   "type": "line",
   "text": "fourteen pointers, low byte first, to each file's two-letter name in $0912 (file 0 at $0912, file 1 at $0914 and so on)."
  },
  {
   "address": 2253,
   "type": "line",
   "text": "file_names, continued: the pointers to files 0 to 13's names, $0912 to $092C, two bytes apart."
  },
  {
   "address": 2280,
   "type": "line",
   "text": "the side of the cassette each file is on, 1 or 2, by file number; the prompt shows it."
  },
  {
   "address": 2294,
   "type": "line",
   "text": "which of the two cassettes each file is on, 1 or 2, by file number; the prompt shows it."
  },
  {
   "address": 2308,
   "type": "line",
   "text": "1 for a file the loader can only find after the tape is rewound (the first of a side the game asks for: M2, S1, S2, BS), 0 for one that follows on the tape from the file before; a 1 shows the rewind prompt first."
  },
  {
   "address": 2322,
   "type": "line",
   "text": "the fourteen two-letter file names in ASCII, as the files' headers carry them: OC OM M1 M2 M3 S1 S2 TP BS T1 T2 T3 T4 CS."
  },
  {
   "address": 2350,
   "type": "line",
   "text": "the prompt \"REWIND TAPE t SIDE s, HIT FIRE THEN PLAY\" on the bottom row: quietens the machine ($0898), shows the ROM's upper-case set on a cleared screen ($09CA), writes the tape and side digits from $08F6 and $08E8 into the text ($098D, $0994), copies the 40 characters to $07C0 in white, starts the cassette motor (bit 5 of $01 cleared), waits for fire ($096C) and blanks the screen for the load."
  },
  {
   "address": 2412,
   "type": "line",
   "text": "waits until bit 4 of either CIA 1 port reads low, with port A made an output: fire on joystick 2 ($DC00), or on joystick 1, the space bar or another key that pulls the same line ($DC01)."
  },
  {
   "address": 2433,
   "type": "line",
   "text": "the prompt's 40 screen codes, \"REWIND TAPE 1 SIDE 1, HIT FIRE THEN PLAY\"; the prompt rewrites the tape digit at $098D and the side digit at $0994."
  },
  {
   "address": 2445,
   "type": "line",
   "text": "the prompt text's tape digit, rewritten from $08F6 by $0947."
  },
  {
   "address": 2452,
   "type": "line",
   "text": "the prompt text's side digit, rewritten from $08E8 by $093E."
  },
  {
   "address": 2473,
   "type": "line",
   "text": "fills the screen at $0400 with spaces and colour RAM with black, then falls into $09CA."
  },
  {
   "address": 2506,
   "type": "line",
   "text": "the video chip on bank 0 with the screen at $0400 and the ROM's upper-case characters ($D018 = $14), screen on, 25 rows, no scroll ($D011 = $98), 40 columns ($D016 = $08)."
  },
  {
   "address": 2540,
   "type": "line",
   "text": "the start year's text before the map: colour RAM red for the first three quarters and black for the last page, border and background black, screen on, the ROM's lower- and upper-case characters ($D018 = $16), so the text the year's file left at $0400 shows in mixed case; then waits for fire ($096C)."
  },
  {
   "address": 2583,
   "type": "line",
   "text": "73 bytes of $BD between the last routine and the loader, then a jmp $0AAA at $0A60 that no instruction reaches: filler."
  },
  {
   "address": 2659,
   "type": "line",
   "text": "the Cyberload loader's entry. A is the mode ($93): bit 0 set loads where the file's header says, clear loads at X/Y (stored into $0B8E/$0B90); bit 1 set returns at once and lets the interrupt finish the load; bit 6 flashes the border; bit 7 compares instead of storing. It switches the ROMs out, points $FFFE at its interrupt ($0ACB) and runs CIA 1's timer A, then waits for the interrupt to set $90 to $FD (done) or $FF (failed) and returns carry set on a failure, with X/Y the end address ($AC/$AD)."
  },
  {
   "address": 2752,
   "type": "line",
   "text": "the loader's pass-through of a raster interrupt: acknowledges it, interrupts on, and jumps through the vector at $03FE."
  },
  {
   "address": 2760,
   "type": "line",
   "text": "a jmp $0ACB that nothing runs: the loader reads its operand as the address of its interrupt ($0A83, $0A89) and puts it in $FFFE/$FFFF."
  },
  {
   "address": 2761,
   "type": "line",
   "text": "loader_irq_vec, continued: the interrupt's address, low byte."
  },
  {
   "address": 2762,
   "type": "line",
   "text": "loader_irq_vec, continued: its high byte."
  },
  {
   "address": 2763,
   "type": "line",
   "text": "the loader's interrupt, one for each pulse on the tape: a raster interrupt goes on to $0AC0; otherwise it reads CIA 1 (the pulse's length against timer A), restarts the timer, flashes the border when mode bit 6 is set, and shifts the bit into $95, branching through the offset at $0AEC, which each state of the loader rewrites."
  },
  {
   "address": 2796,
   "type": "line",
   "text": "the offset of the beq at $0AEB, which is always taken (A is 0): 0 sends each bit to $0AED, which hunts for the sync byte $0F; $18 ($0AF7, once it has come) sends each bit to the byte stage at $0B05; $16 ($0BEB, once the load is over) to $0B03, which ignores the pulses."
  },
  {
   "address": 2821,
   "type": "line",
   "text": "the loader's byte stage: a byte complete in $95 is added to the checksum $9B and handed to the state the branch at $0B19 names; $0B1A, its offset, is rewritten by every state ($0B28, $0B41, $0B80, $0BA6, $0BD1)."
  },
  {
   "address": 2842,
   "type": "line",
   "text": "the offset of the bcs at $0B19, the loader's state, stored by each state for the byte that comes next: 0 (the code from here, waiting for the sync byte $0F), $1E ($0B39, the sync), $34 ($0B4F, the header), $6D ($0B88, the start of a block), $18 ($0B33, to $0BB7: the data) and $1B ($0B36, to $0BE1: the checksum)."
  },
  {
   "address": 2873,
   "type": "line",
   "text": "sync: waits for $0F, then $AA, then clears the byte count $9C and checksum $9B."
  },
  {
   "address": 2895,
   "type": "line",
   "text": "the header: its first bytes must match the name asked for ($BB), else the file is skipped and the loader looks for the next; bytes 16 to 21 go to $AC-$B1 (where to load, the length, the pulse timing)."
  },
  {
   "address": 2925,
   "type": "line",
   "text": "sets CIA 1's timer A from the header's timing ($B0/$B1 times one and a half), the threshold between a short and a long pulse."
  },
  {
   "address": 2952,
   "type": "line",
   "text": "the start of a block: unless mode bit 0 is set, loads at X/Y instead of the header's address; takes the next block's length, up to 256 bytes, from $AE/$AF."
  },
  {
   "address": 2958,
   "type": "line",
   "text": "the low byte of the address to load at when the mode's bit 0 is clear, the operand of the ldx # at $0B8D, stored from X by $0A66."
  },
  {
   "address": 2960,
   "type": "line",
   "text": "the high byte of that address, the operand of the ldy # at $0B8F, stored from Y by $0A69; the code from here takes the block's length and starts it."
  },
  {
   "address": 2999,
   "type": "line",
   "text": "stores a byte with all RAM visible ($01 = $04), or compares it when mode bit 7 is set, and steps $AC/$AD; at the block's end goes back for the checksum."
  },
  {
   "address": 3041,
   "type": "line",
   "text": "the block's checksum: a wrong one ends the load with $90 = $FF; when the length $AE/$AF is used up the load ends with $90 = $FD."
  }
 ]
}