Prev: 9809 Up: Map Next: 9883
986A: Head the player into the room, away from the arrival door
Used by the routine at ENTER_ROOM.
Called by ENTER_ROOM with IX on the arrival half. Bits 7 and 6 of its +$05 say which wall the door is in; doubled, they index ARRIVAL_HEADINGS, and the pair found is written into the player's heading at +$06 and +$07: down from the north wall, up from the south, right from the west, left from the east. With the low nibble of +$02 set to 15, STEER keeps the player walking that way for fifteen frames.
SET_ARRIVAL_HEADING 986A LD A,(IX+$05)
986D RLCA
986E RLCA
986F RLCA
9870 AND $06
9872 LD C,A
9873 LD B,$00
9875 LD HL,ARRIVAL_HEADINGS
9878 ADD HL,BC
9879 LD A,(HL)
987A INC HL
987B LD ($EA96),A
987E LD A,(HL)
987F LD ($EA97),A
9882 RET
Prev: 9809 Up: Map Next: 9883