Prev: CA17 Up: Map Next: CA32
CA1E: Which way does the object face?
Builds the facing code from the two bits that store it: bit 6 of +$07 (the sprite is mirrored) becomes bit 1, and bit 3 of the type (front view) becomes bit 0. So 0 is W, 1 E, 2 N and 3 S.
Input
IX the object
A on exit, the facing: 0 W, 1 E, 2 N, 3 S
get_sprite_dir CA1E LD A,(IX+$07) mirror bit to bit 4
CA21 RRCA
CA22 RRCA
CA23 AND $10
CA25 LD L,A
CA26 LD A,(IX+$00) with type bit 3
CA29 AND $08
CA2B OR L down to bits 1 and 0
CA2C RRCA
CA2D RRCA
CA2E RRCA
CA2F AND $03
CA31 RET
Prev: CA17 Up: Map Next: CA32