Prev: B763 Up: Map Next: B783
B76C: Choose a guard's or the wizard's frame from its direction
Used by the routines at guard_ew_move and upd_30_31_158_159.
The body's version of the facing logic in upd_144_to_149_152_to_157. Bit 0 of the type chooses one of the two drawings -- 30 or 31, 150 or 151, 158 or 159 -- and bit 6 of +7 mirrors it. +X and -Y set bit 0, -X and +Y clear it; +Y and -Y are mirrored. With both deltas 0 nothing changes, so a guard that stops keeps facing the way it was.
The dX and dY comparison is unsigned, as in upd_144_to_149_152_to_157.
set_guard_wizard_sprite B76C LD A,(IX+$09) not moving: leave it
B76F OR (IX+$0A)
B772 RET Z
B773 LD A,(IX+$09) moving along Y?
B776 CP (IX+$0A)
B779 JR C,guard_moving_in_y
B77B BIT 7,A moving -X?
B77D JR NZ,guard_face_minus_x
B77F SET 0,(IX+$00) +X: bit 0 set
Prev: B763 Up: Map Next: B783