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
- Layout: 4 signed bytes each
- Role: The change of block index for one step in each
Direction: −32, +1, +32, −1 for north, east, south and west.0x20e9is used by the neighbor routine, the identical copy at0x3518by the floor routine. - Used by: Directions, Blocks, directions and positions › Directions and coordinates, Level maps (MAZ)
DS:0x22b8, DS:0x22bc, DS:0x22c0 — View sides
- Layout: 3 × 4 bytes, indexed by direction
- Role: For the party's direction d, the side of a block seen from
the front, (d + 2) & 3, the side seen on the left of the view, (d + 1) & 3, and the side seen on the right, (d +
3) & 3. The
view setup copies them to
DS:0x9444,DS:0xdf2bandDS:0xdf4a. - Comparative source: REF-SCUMM-016,
_dscBlockMap. - Used by: Faces and drawing order › Which faces are drawn, Blocks, directions and positions › Directions and coordinates, Monster behavior modes › How each mode behaves, Where each face goes on the screen
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 gives0xff. - Used by: Noticing the party › The check