{
 "chunk": "data_setup_0200",
 "unit": "game/setup_0200",
 "routines": [],
 "variables": [],
 "dataBlocks": [
  {
   "addr": "0200",
   "length": 256,
   "type": "byteTable",
   "name": "contourRuleTable",
   "description": "Terrain-contour rule table of the random map generator, read as contourRuleTable,Y at $7484 in overlay A. Y is an 8-bit mask of which of the eight neighbours of the current cell are higher terrain, bit order bit0=NW, bit1=N, bit2=NE, bit3=W, bit4=E, bit5=SW, bit6=S, bit7=SE (verified from the edge-clamp masks at $7463-$7481: $D6 at column 0, $6B at column 39, $F8 at row 0, $1F at row 39). Entry semantics: $00 (index 0 only) do nothing; $41-$51 a contour tile code to place, from which the generator subtracts contourTileOffset ($0324, 0 for the summit ring and $20 for the lower-hill ring) - $51 north edge, $4D south, $4B west, $49 east, $45 N+W corner, $46 N+E, $47 W+S, $48 E+S, $44/$43/$42/$41 the isolated NW/NE/SW/SE diagonals; $80+n (105 entries) randomly erase neighbour n instead; $91/$95/$97 (indexes $05, $A0, $84) erase that neighbour or else fill; $FF (93 entries) fill the cell with the interior tile. Loaded from track 18 sector 15 by loadSetupBlock ($10BB) / loadMapAndSetup_10AB and never written back to disk. Only valid between $0B35 and $7AE9, after which the trainer playbook (track 29 s6-8) overwrites the page."
  },
  {
   "addr": "0389",
   "length": 119,
   "type": "unknown",
   "name": "setupBlockPadding",
   "description": "$0389-$03FF, all zero on disk: the tail of track 18 sector 16 after the one-shot start-up code at $0300-$0388. Not referenced as code or data. At run time the page is reused for the film directory, the RLE sprite-shape buffer, overlay A's map-generator variables and the trainer playbook."
  }
 ],
 "misclassified": [],
 "insights": [
  "The block that ships in track 18 sectors 15-16 is 256 bytes of pure data (contourRuleTable) followed by 137 bytes of one-shot start-up code ($0300-$0388, surveyed in game_setup_0200_0200.json) and 119 zero bytes; there are no strings in it.",
  "Neighbour-mask bit order for the whole map generator: bit0=NW, bit1=N, bit2=NE, bit3=W, bit4=E, bit5=SW, bit6=S, bit7=SE (reading order, centre skipped).",
  "XREF.txt and the include lists of other files carry boot-era names for addresses in this block: $0300 appears as basicVectorHijack and $02B8/$02EC as eaLoadGame/eaFileName, all from boot/ea.s which loaded to $02A8-$030B before the game started."
 ]
}
