Prev: C58D Up: Map Next: C5D3
C5BD: Which way an object faces
Used by the routines at FIRE, HANDLE_LEFT_RIGHT and CALC_PLYR_DUV.
The facing, 0 to 3, from the two bits that store it: bit 6 of the flags (mirrored) clear gives 2, and bit 2 of the graphic adds 1. So 0 faces lower U, 1 higher U, 2 higher V and 3 lower V (see HANDLE_LEFT_RIGHT). Knight Lore's is the same with bit 3 of the type in place of bit 2.
Input
IX The object
Output
A The facing
GET_SPRITE_DIR C5BD LD A,(IX+$07) L = 8 if the sprite is not mirrored
C5C0 RRCA
C5C1 RRCA
C5C2 RRCA
C5C3 AND $08
C5C5 XOR $08
C5C7 LD L,A
C5C8 LD A,(IX+$00) With the graphic's bit 2
C5CB AND $04
C5CD OR L
C5CE RRCA Down to bits 1 and 0
C5CF RRCA
C5D0 AND $03
C5D2 RET
Prev: C58D Up: Map Next: C5D3