Skip to main content

Geometry data

Data · Routines · Address index

Direction steps and the offsets and sides of the view. The data page explains how the entries are written.

DS:0x20e9, DS:0x3518 — Direction steps​

DS:0x22b8, DS:0x22bc, DS:0x22c0 — View sides​

DS:0x22c4 — View offsets​

  • Layout: 4 × 18 signed bytes, indexed by direction
  • Role: For each direction, the block-index offsets of the 18 visible blocks: seven three steps ahead, five two steps ahead, three one step ahead and the party's row, each row listed from the facing − 1 side to the facing + 1 side. For north: −99 to −93, −66 to −62, −33 to −31, then −1, 0 and +1.
  • Comparative source: REF-SCUMM-016, _dscBlockIndex.
  • Used by: The dungeon view › The 18 visible blocks, Tools

DS:0x6180 — Direction lookup​

  • Layout: 16 bytes: ff 06 02 ff 04 05 03 ff 00 07 01 ff ff ff ff ff
  • Role: Lookup table used by the direction routine to turn a relative position into one of eight directions. With dy = start row − target row and dx = target column − start column, the index adds 8 when 2 dy ≥ |dx|, 4 when −2 dy ≥ |dx|, 2 when 2 dx ≥ |dy| and 1 when −2 dx ≥ |dy| (0x2a9cf–0x2a9f2). Indexes 8, 10, 2, 6, 4, 5, 1 and 9 give the directions 0 to 7, clockwise from north; the same block sets all four bits and gives 0xff.
  • Used by: Noticing the party › The check