Skip to main content

Movement and geometry routines

Routines · Data · Address index

The movement buttons, the party's step, and the computations of neighboring blocks, directions and distances. The routines page explains how the entries are written.

0x1bfe0, 0x1c018, 0x1c0a5, 0x1c0ed, 0x1c05f, 0x1c082 — Movement buttons​

0x1bb3f — Refuse a step​

0x1e2d1 — Test whether a block can be entered​

0x1e36f — Next block in a direction​

0x24f36 — Move the party​

0x2a996 — Direction between two blocks​

  • Range: 0x2a996–0x2a9ff
  • Role: Returns one of eight directions from one block to another, using the direction table. With dy = row of the first block − row of the second and dx = column of the second − column of the first, it sets bit 8 when 2 × dy ≥ |dx|, 4 when −2 × dy ≥ |dx|, 2 when 2 × dx ≥ |dy| and 1 when −2 × dx ≥ |dy| (0x2a9cd–0x2a9f2), and reads the table at that index: 8 north, 10 northeast, 2 east, 6 southeast, 4 south, 5 southwest, 1 west, 9 northwest, which the table turns into 0 to 7 clockwise from north. A direction is thus diagonal when twice each difference is at least the other. Two equal blocks set all four bits and give 0xff, returned in AL with AH cleared (0x00ff, 0x2a9f3–0x2a9f5).
  • Comparative source: REF-SCUMM-008, REF-SCUMM-020, getNextMonsterDirection.
  • Used by: Noticing the party › The check

0x2b658 — Distance between two blocks​