{
 "schema": 1,
 "platform": "c64",
 "game": "gunship",
 "part": "base",
 "build": "original disk, Rapidlok V6, PAL, C64 Preservation Project gunship_s1/s2[microprose_1985](rl6)(pal)",
 "source": "regenerator2000 live",
 "regions": {
  "exclude": [
   [
    256,
    511,
    "stack"
   ],
   [
    53248,
    57343,
    "I/O and colour RAM"
   ],
   [
    51200,
    52223,
    "screen RAM"
   ],
   [
    0,
    2048,
    "Machine-code library"
   ],
   [
    25849,
    40959,
    "Machine-code library"
   ],
   [
    49152,
    52223,
    "Machine-code library"
   ],
   [
    52845,
    65535,
    "Machine-code library"
   ]
  ],
  "extra": [
   [
    49152,
    51199,
    "character set"
   ]
  ],
  "edges": [
   0,
   256,
   512,
   1024,
   2048,
   4096,
   16384,
   32768,
   40960,
   49152,
   53248,
   57344
  ],
  "elsewhere": [
   [
    0,
    2048,
    "Machine-code library"
   ],
   [
    25849,
    40959,
    "Machine-code library"
   ],
   [
    49152,
    52223,
    "Machine-code library"
   ],
   [
    52845,
    65535,
    "Machine-code library"
   ]
  ]
 },
 "blocks": [
  {
   "start": 2049,
   "end": 25848,
   "type": "BASIC"
  },
  {
   "start": 40960,
   "end": 49151,
   "type": "Byte"
  },
  {
   "start": 52224,
   "end": 52338,
   "type": "Code"
  },
  {
   "start": 52339,
   "end": 52417,
   "type": "Byte"
  },
  {
   "start": 52418,
   "end": 52641,
   "type": "Code"
  },
  {
   "start": 52642,
   "end": 52718,
   "type": "Byte"
  },
  {
   "start": 52719,
   "end": 52788,
   "type": "Code"
  },
  {
   "start": 52789,
   "end": 52791,
   "type": "Byte"
  },
  {
   "start": 52792,
   "end": 52844,
   "type": "Code"
  }
 ],
 "symbols": [
  {
   "address": 2049,
   "name": "base_list_guard",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2061,
   "name": "base_setup",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2176,
   "name": "base_lamps",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2233,
   "name": "base_digits",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2300,
   "name": "base_fuel",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2658,
   "name": "base_rounds",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 2751,
   "name": "base_stations",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 3277,
   "name": "base_chaff",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 3701,
   "name": "base_grid",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 3913,
   "name": "base_roster_io",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 4236,
   "name": "score",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 4827,
   "name": "promotion",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 5117,
   "name": "medals",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 5642,
   "name": "medal_mark",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 5694,
   "name": "base_decorations",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 6024,
   "name": "record_bytes",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 6457,
   "name": "base_start",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 6508,
   "name": "base_read_pilot",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 6934,
   "name": "base_rank",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 7069,
   "name": "award",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 7293,
   "name": "base_turn_disk",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 7717,
   "name": "hits",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 7885,
   "name": "take_off",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 8188,
   "name": "repair",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 8562,
   "name": "rearm",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 9546,
   "name": "rearm_click",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 10469,
   "name": "rearm_done",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 10774,
   "name": "base_unit",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 11045,
   "name": "base_mission_name",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 11680,
   "name": "stand_by",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 12141,
   "name": "citations",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 12917,
   "name": "citations_2",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 13389,
   "name": "citations_3",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 13976,
   "name": "end_game",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 14045,
   "name": "base_load",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 14340,
   "name": "base_setting_up",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 15315,
   "name": "base_pilot",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 15615,
   "name": "base_display",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 15717,
   "name": "crash",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 16358,
   "name": "medals_picture",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 16408,
   "name": "what_next",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 17228,
   "name": "what_next_click",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 17566,
   "name": "inspect",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 18314,
   "name": "quit",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 19100,
   "name": "debriefing",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 19990,
   "name": "record_screen",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 20593,
   "name": "promotion_screen",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 21578,
   "name": "objective_state",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 21806,
   "name": "citation_screen",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 22223,
   "name": "top_missions",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 22967,
   "name": "service_record",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 23824,
   "name": "top_missions_click",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 24342,
   "name": "what_next_2",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 24709,
   "name": "what_next_click_2",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 25393,
   "name": "base_style_name",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 25495,
   "name": "base_continue",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 25634,
   "name": "base_data",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 40960,
   "name": "damage_chars",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 41984,
   "name": "damage_chars_2",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 43008,
   "name": "damage_screen",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 44032,
   "name": "damage_colours",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 45056,
   "name": "stores_chars",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 46080,
   "name": "stores_chars_2",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 47104,
   "name": "stores_screen",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 48128,
   "name": "stores_colours",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52224,
   "name": "sys_52224",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52227,
   "name": "systems_damage",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52242,
   "name": "b_CC12",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52255,
   "name": "b_CC1F",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52272,
   "name": "b_CC30",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52291,
   "name": "b_CC43",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52318,
   "name": "b_CC5E",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52326,
   "name": "b_CC66",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52339,
   "name": "lamp_lo",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52353,
   "name": "lamp_hi",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52367,
   "name": "damage_severity",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52381,
   "name": "lamp_colours",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52384,
   "name": "block_lo",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52398,
   "name": "block_shape",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52412,
   "name": "rotor_lo",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52415,
   "name": "rotor_shape",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52418,
   "name": "stores_status",
   "type": "Jump",
   "kind": "user"
  },
  {
   "address": 52437,
   "name": "b_CCD5",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52448,
   "name": "b_CCE0",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52482,
   "name": "b_CD02",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52517,
   "name": "b_CD25",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52520,
   "name": "j_CD28",
   "type": "Jump",
   "kind": "auto"
  },
  {
   "address": 52524,
   "name": "print_stores",
   "type": "UserDefined",
   "kind": "user"
  },
  {
   "address": 52559,
   "name": "b_CD4F",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52580,
   "name": "b_CD64",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52590,
   "name": "chaff_operand",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 52591,
   "name": "b_CD6F",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52611,
   "name": "light_lamps",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 52625,
   "name": "b_CD91",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52633,
   "name": "b_CD99",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52642,
   "name": "store_lamp_lo",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52651,
   "name": "store_lamp_hi",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52660,
   "name": "store_severity",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52667,
   "name": "store_colours",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52670,
   "name": "store_block_lo",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52677,
   "name": "store_block_shape",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52684,
   "name": "fore_fuel",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 52685,
   "name": "aft_fuel",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 52686,
   "name": "store_lo",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52694,
   "name": "store_hi",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52702,
   "name": "double_mask",
   "type": "AbsoluteAddress",
   "kind": "user"
  },
  {
   "address": 52703,
   "name": "number_lo",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52711,
   "name": "number_hi",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52719,
   "name": "print_number",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 52731,
   "name": "j_CDFB",
   "type": "Jump",
   "kind": "auto"
  },
  {
   "address": 52745,
   "name": "b_CE09",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52752,
   "name": "b_CE10",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52780,
   "name": "b_CE2C",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52782,
   "name": "b_CE2E",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52789,
   "name": "powers_of_ten",
   "type": "Field",
   "kind": "user"
  },
  {
   "address": 52792,
   "name": "fill_block",
   "type": "Subroutine",
   "kind": "user"
  },
  {
   "address": 52814,
   "name": "b_CE4E",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52821,
   "name": "b_CE55",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52825,
   "name": "b_CE59",
   "type": "Branch",
   "kind": "auto"
  },
  {
   "address": 52841,
   "name": "b_CE69",
   "type": "Branch",
   "kind": "auto"
  }
 ],
 "comments": [
  {
   "address": 2049,
   "type": "line",
   "text": "E, the base program's BASIC, starts here, its first two bytes BASIC's link to the next line. Line 0: the same LIST guard as BEGIN's, five DELETEs that rub out \"0 REM\"."
  },
  {
   "address": 2061,
   "type": "line",
   "text": "Lines 5-10: CIA 1's interrupts, the STOP key and RESTORE switched off, BASIC's top lowered to $7400, white letters, the case switch locked, CL$ a blank record; then the setting up at 20000."
  },
  {
   "address": 2176,
   "type": "line",
   "text": "Lines 12-14: colour the lamps beside the chaff (12) and the flares (14) on the rearming screen."
  },
  {
   "address": 2233,
   "type": "line",
   "text": "Lines 18-19: print V as SD digits with leading zeros."
  },
  {
   "address": 2300,
   "type": "line",
   "text": "Lines 20-38, rearming's fuel, the same as BEGIN's lines 13-27: add I to the fuel within what can be lifted, redraw the two gauges in the font, and show the weight, in red for a moment when refused."
  },
  {
   "address": 2658,
   "type": "line",
   "text": "Lines 40-46: add I to the cannon's rounds, in twenties."
  },
  {
   "address": 2751,
   "type": "line",
   "text": "Lines 50-96: the three pairs of stations, as BEGIN's 31-46, except that a damaged wing loses its station: LW and RW are 0 for a wing that is gone, BW half for one wing, and the sprites and weights follow them."
  },
  {
   "address": 3277,
   "type": "line",
   "text": "Lines 100-138: chaff and flares, which can be loaded only while their dispensers work (CD, FD), and only one of the two if one dispenser is gone; their lamps and counts."
  },
  {
   "address": 3701,
   "type": "line",
   "text": "Lines 140-162: a mission's grid reference and AT or IN THE VICINITY OF, as BEGIN's 57-61."
  },
  {
   "address": 3913,
   "type": "line",
   "text": "Lines 200-280: read the roster from side 1 (200-230) and save it (250-280), as BEGIN's 62-70."
  },
  {
   "address": 4236,
   "type": "line",
   "text": "Lines 400-482, the mission's score. Each destroyed unit (ET 0, its kind in EG) adds S% for its kind, 0 to 28, or takes 30, 60 or 80 off for a friendly one, and counts in H, the enemy's losses less the friendly; the nearest live unit to where the helicopter ended says whether it landed at a friendly base (kind 38 within 5, HL) or among friendly units (LS). To the sum go 30 for each of HH, 200 for the primary objective and 100 for the secondary (OB's bits 0 and 1); it is multiplied for the theatre (U, 1 to 2), the enemy's quality (Q, 1 to 1.5) and the style (SF, 1 to 2); easy flight takes 10 % off, easy landings and easy weather 20 % each, a flight longer than 4096 is cut in proportion, ending away from friendly units takes 40 % off and among them but away from a base 20 %; a tenth of it is the mission's score, added to the total SC. Training scores only 20 when LN is below 4 and 10 for an objective."
  },
  {
   "address": 4827,
   "type": "line",
   "text": "Lines 486-496: the total and the mission's score into the record (bytes 21-22 and 48-49); no promotion for a colonel, nor after a mission with no objective destroyed above sergeant; otherwise the next rank comes when the total reaches its mark, R(rank) (1 to 10000), times 1.1 for each reprimand (byte 23), 0.9 for each Air Medal, Bronze Star and Silver Star (29, 32, 33) and 0.8 for each Distinguished Service Cross and Medal of Honor (34, 35)."
  },
  {
   "address": 5117,
   "type": "line",
   "text": "Lines 498-560, what the mission earns, as codes in R(): with no objective destroyed, byte 47 counts failures in a row, and a reprimand (23) comes with the fifth for a sergeant or warrant officer, the fourth up to captain and the third above, or with a score below 0; a serious wound (WD 2) earns the Purple Heart (30); bytes 36-39 count successes in each theatre, and the third earns its campaign ribbon (the theatre's number); a mission with an objective destroyed earns the highest of the Army Commendation Medal, Bronze Star, Silver Star, Distinguished Service Cross and Medal of Honor (31-35) whose mark (590) its score beats, the higher ones needing a rank and the Medal of Honor a hit taken. Training (550) gives the National Defense Service Medal (24) when LN is below 4 and more than one enemy was destroyed."
  },
  {
   "address": 5642,
   "type": "line",
   "text": "Lines 590-592: the score a medal needs: J times one more than how many of it the pilot holds, at most 8000 less 500 for each step up."
  },
  {
   "address": 5694,
   "type": "line",
   "text": "Lines 800-820: DC$(J), pilot J's fate and decorations, from M$."
  },
  {
   "address": 6024,
   "type": "line",
   "text": "Lines 900-990: set byte I of the pilot's record to V (900) or add one to it (910); print I$ in large letters on bitmap row I (920-922); read word I of the mission block (930); print V times 10 (940-942); fill the large text (950); the pointer's place (960); read byte I (970); split V (980-982); write word I of the mission block (990)."
  },
  {
   "address": 6457,
   "type": "line",
   "text": "Lines 1000-1022: a crash (LN below 2) goes to 21000; an abort (LN above 127) straight to BEGIN; otherwise the score (7000)."
  },
  {
   "address": 6508,
   "type": "line",
   "text": "Lines 4300-4390: the pilot's name, rank, decorations, score, choices, mission, campaign counts and failures, from the record."
  },
  {
   "address": 6934,
   "type": "line",
   "text": "Lines 4600-4612: the rank's name, and pilot I's score."
  },
  {
   "address": 7069,
   "type": "line",
   "text": "Lines 5000-5144: the medals picture loaded (21300), the score and promotion (486), then each award in R() counted in its byte of the record: a campaign ribbon becomes its theatre's ribbon (25-28) the first time and an Air Medal (29) after that; BM, the highest code, picks the citation; a reprimand is taken out of the list of medals shown."
  },
  {
   "address": 7293,
   "type": "line",
   "text": "Lines 6000-6080: Turn disk over and insert it, front or back, and check its side, as BEGIN's 750-759."
  },
  {
   "address": 7717,
   "type": "line",
   "text": "Lines 7000-7990: score the mission (400); then the wound, WD: 1 when HT, the hits taken, is over 2; 2 when it is over 4 and bit 5 of the flight time is set, or when more than 11 of the damage word's 16 bits are set; then What Next (22000)."
  },
  {
   "address": 7885,
   "type": "line",
   "text": "Lines 10000-10950: Take off again: \"Preflight Systems Check\"; the map's characters saved at $D000 put back at $A800 (KE+78); side 2 asked for; NEW, then LOAD \"6\" with two RETURNs in the keyboard buffer, which runs it."
  },
  {
   "address": 8188,
   "type": "line",
   "text": "Lines 12000-12100: \"Repairing Damage\": the damage, hits and wound words cleared in the mission block; and some of the destroyed enemies, each with a chance of DN in 5, come back, hidden from the map, in the square they were in."
  },
  {
   "address": 8562,
   "type": "line",
   "text": "Lines 13000-13150: rearm: the temperature, the wings and dispensers the damage leaves (LW, RW, CD, FD); AR loaded at $B000 and swapped in for the font and screen, its colours put in colour RAM; then the standard load for the theatre, as BEGIN's 509-533."
  },
  {
   "address": 9546,
   "type": "line",
   "text": "Lines 13190-13325: the rearming screen's buttons, as BEGIN's 534-559, the stations of a lost wing refused."
  },
  {
   "address": 10469,
   "type": "line",
   "text": "Lines 13900-13930: the memory swapped back; or the new load written into the mission block (fuel in two tanks, rounds, Sidewinders, FFARs, Hellfires, flares and chaff, each halved for a lost wing or dispenser) and take off (10000)."
  },
  {
   "address": 10774,
   "type": "line",
   "text": "Lines 14110-14123: UN$, the unit, and AR$, the theatre's name."
  },
  {
   "address": 11045,
   "type": "line",
   "text": "Lines 14150-14193: MD$, the mission's target, as BEGIN's 602-631."
  },
  {
   "address": 11680,
   "type": "line",
   "text": "Lines 14400-14540: a message alone on the text screen at $0400 (14400-14410); the display for the menus (14440-14490 and 14500-14540)."
  },
  {
   "address": 12141,
   "type": "line",
   "text": "Lines 14600-14643: the citations, picked by MD, the award's code less 22: peeling potatoes for a reprimand (PO), the Purple Heart (PU), the National Defense Service Medal and a campaign ribbon (ST); each names its picture in F$."
  },
  {
   "address": 12917,
   "type": "line",
   "text": "Lines 14650-14672: the Air Medal, the Army Commendation Medal and the Bronze Star for Valor (ST)."
  },
  {
   "address": 13389,
   "type": "line",
   "text": "Lines 14680-14703: the Silver Star and the Distinguished Service Cross (SI), and the Congressional Medal of Honor (TH)."
  },
  {
   "address": 13976,
   "type": "line",
   "text": "Lines 15000-15010: End Game: side 1, the roster saved, the reset vector's signature cleared ($8004), and SYS 64738, a reset."
  },
  {
   "address": 14045,
   "type": "line",
   "text": "Lines 16000-16090: load F$ at its own address with the KERNAL's LOAD, until it loads without error."
  },
  {
   "address": 14340,
   "type": "line",
   "text": "Lines 20000-20312: the setting up: OP loaded, the library again; the names of its tables and the theatre's, as in BEGIN; the decorations' abbreviations M$; the DATA read; the roster's records cleared."
  },
  {
   "address": 15315,
   "type": "line",
   "text": "Lines 20410-20509: the pilot (word 59); with none, straight back to BEGIN; the pilot's record taken from the mission block ($0362) and its words read: where the helicopter ended (XP, YP), damage, hits, time, HH, how it landed (LN), the objectives (OB) and the fuel."
  },
  {
   "address": 15615,
   "type": "line",
   "text": "Lines 20900-20990: the interrupts and display; \"Please Stand By\"; then 1000."
  },
  {
   "address": 15717,
   "type": "line",
   "text": "Lines 21000-21210: Fatal Crash!: the crash picture (CR) unpacked and shown above the text: the pilot's career is over, a permanent casualty, personal effects to the next of kin; the pilot marked killed (byte 46), the awards, and on to the records."
  },
  {
   "address": 16358,
   "type": "line",
   "text": "Lines 21300: load ME, the medals picture, at $97FB, and save it for the tiles (KE+45)."
  },
  {
   "address": 16408,
   "type": "line",
   "text": "Lines 22000-22418: What Next, Hotshot?: inspect the machine for damage; take off again at once; rearm and refuel without repairs; rearm, refuel and repair; or leave the chopper and call it quits. A choice the state of things rules out is printed grey (22250-22352); 22800 sets each button's place in the button tables."
  },
  {
   "address": 17228,
   "type": "line",
   "text": "Lines 22450-22808: the five buttons drawn (22600) and the choice taken: 23000, 10000, 13000, 12000 or 23500."
  },
  {
   "address": 17566,
   "type": "line",
   "text": "Lines 23000-23470: Personally Inspect Your Machine: the first picture at $A000 swapped in for the font and screen, its colours from $AC00, and the damage drawn on it (SYS 52227); then the second, at $B000 with colours from $BC00, with the stores left (SYS 52224); then back to What Next."
  },
  {
   "address": 18314,
   "type": "line",
   "text": "Lines 23500-23910: leaving the helicopter: seriously wounded behind enemy lines, missing in action; or abandoned behind enemy lines and back to friendly lines by luck; or abandoned behind friendly lines, which the commander frowns on; with no wound, at a base, the records follow."
  },
  {
   "address": 19100,
   "type": "line",
   "text": "Lines 24000-24060: Debriefing: the mission, how it went (a total disaster to an outstanding success), each objective untouched, damaged or annihilated, the other enemies' casualties by H, the mission's score and the total."
  },
  {
   "address": 19990,
   "type": "line",
   "text": "Lines 24070-24240: Reviewing Your Record: the bitmap screen's window set up and framed, the large-letter rows cleared."
  },
  {
   "address": 20593,
   "type": "line",
   "text": "Lines 24250-24499: a promotion and its insignia (24260-24290), and the medals awarded as tiles of the medals picture (24300-24401), then Continue and the citation (25000)."
  },
  {
   "address": 21578,
   "type": "line",
   "text": "Lines 24500-24630: print an objective UNTOUCHED, DAMAGED or ANNIHILATED (24500-24503); draw medal I's tile at column X (24600-24630), a Medal of Honor as three."
  },
  {
   "address": 21806,
   "type": "line",
   "text": "Lines 25000-25210: the highest award's citation, its picture (PO, PU, ST, SI or TH) unpacked and shown above it."
  },
  {
   "address": 22223,
   "type": "line",
   "text": "Lines 26000-26095: the roster read again and the pilot's record put back; the Greatest Gunship Missions, records 9 and 10, the two best mission scores (bytes 48-49), replaced when this one beats them, printed with their pilots' ranks, names and decorations."
  },
  {
   "address": 22967,
   "type": "line",
   "text": "Lines 26100-26162: Your Current Service Record: the pilot's rank, name and score, and every decoration held drawn as a tile (26600)."
  },
  {
   "address": 23824,
   "type": "line",
   "text": "Lines 26170-26610: Clear Top Scores, End Game or Continue; Continue saves the roster on side 1 and goes on to 27000; 26600 draws one tile."
  },
  {
   "address": 24342,
   "type": "line",
   "text": "Lines 27000-27060: a dead pilot (byte 46) goes straight back to BEGIN; otherwise the What Next? choices printed: fly another mission of the same style in the theatre, change style, transfer to a new unit, or go on extended R&R."
  },
  {
   "address": 24709,
   "type": "line",
   "text": "Lines 27190-27370: the four buttons; the choice into the mission block's word 62 for BEGIN, side 1 asked for, and LOAD \"BEGIN\" through the keyboard buffer."
  },
  {
   "address": 25393,
   "type": "line",
   "text": "Lines 27900-27930: the style of mission's name."
  },
  {
   "address": 25495,
   "type": "line",
   "text": "Lines 30000-30004: a Continue button, and wait for it."
  },
  {
   "address": 25634,
   "type": "line",
   "text": "Lines 32006-32060: the DATA: the weapons' weights, rounds and colours, as BEGIN's; the points for each kind of enemy (1 to 13) and the losses for friendlies (33, 34, 38); the multipliers for the theatres, the enemy's quality and the style; and the scores for each rank."
  },
  {
   "address": 40960,
   "type": "line",
   "text": "The systems damage picture, file 2, which the debriefing loaded: its character set, 256 multicolour characters of 8 bytes, which line 23020 swaps with the font at $C000 (KE+51) to show it."
  },
  {
   "address": 41984,
   "type": "line",
   "text": "The second half of the systems damage picture's character set."
  },
  {
   "address": 43008,
   "type": "line",
   "text": "The systems damage picture's screen, 1000 character codes, swapped with the screen at $C800 with the character set; the 24 bytes after it are not shown."
  },
  {
   "address": 44032,
   "type": "line",
   "text": "The systems damage picture's colours, which line 23022 copies to colour RAM at $D800 (KE+48); only the low four bits of each count."
  },
  {
   "address": 45056,
   "type": "line",
   "text": "The stores status picture, file 1, which the debriefing loaded: its character set, swapped with the font at $C000 by line 23222. Rearming loads AR, the rearming screen, over it."
  },
  {
   "address": 46080,
   "type": "line",
   "text": "The second half of the stores status picture's character set."
  },
  {
   "address": 47104,
   "type": "line",
   "text": "The stores status picture's screen, 1000 character codes; the 24 bytes after it are not shown."
  },
  {
   "address": 48128,
   "type": "line",
   "text": "The stores status picture's colours, copied to colour RAM by line 23242 (and by 13026 for the rearming screen loaded over it); only the low four bits of each count."
  },
  {
   "address": 52224,
   "type": "line",
   "text": "The base's own code, which comes in with OP. SYS 52224 (line 23310) jumps to stores_status; SYS 52227 is the next instruction, systems_damage."
  },
  {
   "address": 52227,
   "type": "line",
   "text": "SYS 52227, for the systems damage picture (line 23120). For each of the 14 bits of the damage word (word 54 of the mission block, $03A8), bit 0 first, colour the part of the helicopter it stands for and light one of the three lamps beside its name: green when the bit is clear, yellow or red (damage_severity) when it is set. From bit 0: main rotor, antitorque rotor, port engine, starboard engine, forward avionics, aft avionics, nose optics, flare launcher, forward fuel, aft fuel, starboard wing, port wing, 30 mm chain gun, chaff launcher."
  },
  {
   "address": 52238,
   "type": "line",
   "text": "14 systems, counted down in zpa_20 from 13, the index into the tables."
  },
  {
   "address": 52252,
   "type": "line",
   "text": "The bit is set: 1 or 2, yellow or red."
  },
  {
   "address": 52259,
   "type": "line",
   "text": "The colour, from lamp_colours."
  },
  {
   "address": 52264,
   "type": "line",
   "text": "The main rotor, index 13, has three more blocks to colour: its blades."
  },
  {
   "address": 52291,
   "type": "line",
   "text": "The system's block of the picture."
  },
  {
   "address": 52304,
   "type": "line",
   "text": "Its lamps, in colour RAM."
  },
  {
   "address": 52316,
   "type": "line",
   "text": "Six cells, two to a lamp: the lamp at zpa_1F (1, 3 or 5) in the colour, the other two black ($08)."
  },
  {
   "address": 52339,
   "type": "line",
   "text": "Low bytes of each system's row of lamps in colour RAM, by index (13 less the bit)."
  },
  {
   "address": 52353,
   "type": "line",
   "text": "High bytes of each system's row of lamps."
  },
  {
   "address": 52367,
   "type": "line",
   "text": "How each system shows when its bit is set, by index: 1 yellow, 2 red."
  },
  {
   "address": 52381,
   "type": "line",
   "text": "Green, yellow and red: $0D, $0F, $0A, with bit 3 set for a multicolour character."
  },
  {
   "address": 52384,
   "type": "line",
   "text": "Low byte of each system's block of the picture in colour RAM, by index."
  },
  {
   "address": 52398,
   "type": "line",
   "text": "Each block's shape, for fill_block."
  },
  {
   "address": 52412,
   "type": "line",
   "text": "The main rotor's three blades: their low bytes in colour RAM."
  },
  {
   "address": 52415,
   "type": "line",
   "text": "The three blades' shapes."
  },
  {
   "address": 52418,
   "type": "line",
   "text": "SYS 52224, for the stores status display (line 23310). Bits 7 to 13 of the damage word, the flare launcher first, colour the part of the picture each stands for and light its lamps, as systems_damage does; the two wings, where the Hellfires, the Sidewinders and the FFARs hang, light those three rows together, yellow for one wing lost and red for both. Then the eight numbers."
  },
  {
   "address": 52419,
   "type": "line",
   "text": "Bits 7 to 14 of the damage word, into zpa_1D."
  },
  {
   "address": 52468,
   "type": "line",
   "text": "Index 3, the starboard wing: its state kept in zpa_1E, and no lamp of its own."
  },
  {
   "address": 52482,
   "type": "line",
   "text": "Index 2, the port wing: the two wings' states added, and the rows for the Hellfires (7), the Sidewinders (8) and the FFARs (2) lit by the sum."
  },
  {
   "address": 52524,
   "type": "line",
   "text": "The eight numbers of the stores display, from the top: the cannon's rounds (word 10, doubled, before a 0 the picture holds: 20 rounds to one), the fore fuel (word 3 divided by 128), the Sidewinders (word 11), the Hellfires (word 13), the 2.75 inch FFARs (word 12, doubled), the aft fuel (word 4 divided by 128), the chaff (word 15) and the flares (word 14), each three times its word. Only the low byte of each word is read."
  },
  {
   "address": 52575,
   "type": "line",
   "text": "A set bit of double_mask doubles the number."
  },
  {
   "address": 52580,
   "type": "line",
   "text": "The last two, the chaff and the flares, times three: the number written into the ADC's operand, doubled and added to it."
  },
  {
   "address": 52589,
   "type": "line",
   "text": "Its operand is written by the STA three instructions back ($CD68)."
  },
  {
   "address": 52590,
   "type": "line",
   "text": "The ADC's operand, written by the STA at $CD68 with the number itself, so that the ADC makes it three times over."
  },
  {
   "address": 52611,
   "type": "line",
   "text": "Light one row of three lamps: Y the row (store_lamp_lo), zpa_1F the lamp less one (0, 2 or 4) before it adds one, zpa_A6 the colour; the other two black."
  },
  {
   "address": 52642,
   "type": "line",
   "text": "Low bytes of each row of lamps in colour RAM: chaff, rounds, FFARs, the same again (not used), aft fuel, fore fuel, flares, Hellfires, Sidewinders."
  },
  {
   "address": 52651,
   "type": "line",
   "text": "High bytes of each row of lamps."
  },
  {
   "address": 52660,
   "type": "line",
   "text": "How each system shows when its bit is set, by index (13 less the bit): 1 yellow, 2 red."
  },
  {
   "address": 52667,
   "type": "line",
   "text": "Green, yellow and red, as lamp_colours."
  },
  {
   "address": 52670,
   "type": "line",
   "text": "Low byte of each system's block of the stores picture in colour RAM."
  },
  {
   "address": 52677,
   "type": "line",
   "text": "Each block's shape in the stores picture, for fill_block."
  },
  {
   "address": 52684,
   "type": "line",
   "text": "The fore tank's fuel, word 3 divided by 128."
  },
  {
   "address": 52685,
   "type": "line",
   "text": "The aft tank's fuel, word 4 divided by 128."
  },
  {
   "address": 52686,
   "type": "line",
   "text": "Where each number is read, low bytes, by row from the bottom: flares, chaff, aft fuel, FFARs, Hellfires, Sidewinders, fore fuel, rounds."
  },
  {
   "address": 52694,
   "type": "line",
   "text": "Where each number is read, high bytes: the mission block at $0350-$035B, or the two fuel bytes above."
  },
  {
   "address": 52702,
   "type": "line",
   "text": "$11: the first and fifth numbers printed, the rounds and the FFARs, are doubled."
  },
  {
   "address": 52703,
   "type": "line",
   "text": "Where each number is printed on the screen at $C800, low bytes, by row from the bottom."
  },
  {
   "address": 52711,
   "type": "line",
   "text": "Where each number is printed, high bytes."
  },
  {
   "address": 52719,
   "type": "line",
   "text": "Print zpa_A5 (0 to 255) as three digits at (zpa_A6), with spaces for leading zeros."
  },
  {
   "address": 52766,
   "type": "line",
   "text": "Always taken: zpa_A8 holds the last digit's character, $30 to $39, never 0."
  },
  {
   "address": 52770,
   "type": "line",
   "text": "Never runs, for that reason: it would print a space for the cannon's last digit (zpa_FE 7), so that no rounds read as a blank before the picture's 0."
  },
  {
   "address": 52789,
   "type": "line",
   "text": "1, 10 and 100."
  },
  {
   "address": 52792,
   "type": "line",
   "text": "Fill a block of colour RAM with zpa_A6's colour. A gives its shape: bits 0-1 the page above $D800, bits 2-4 the width less one (7 meaning ten), bits 5-7 the height less one; zpa_A7 is the low byte of its top left corner."
  }
 ]
}