Prev: 56358 Up: Map Next: 56403
56375: Reverse Direction
Used by the routines at Handler_MovingObjects and Handler_Enemies.
Negates both deltas and flips facing when the horizontal delta is non-zero.
Input
IX Entity record
Negate the vertical delta.
Reverse_Direction 56375 LD A,(IX+9) Fetch the vertical delta and decrease it by one.
56378 DEC A
56379 XOR %11111111 Invert every bit.
56381 LD (IX+9),A Write the negated vertical delta.
Negate the horizontal delta.
56384 LD A,(IX+8) Fetch the horizontal delta and decrease it by one.
56387 DEC A
56388 XOR %11111111 Invert every bit.
56390 LD (IX+8),A Write the negated horizontal delta.
56393 RET Z Return if it is now zero.
Flip the facing bit.
56394 LD A,128 Toggle bit 7 of *IX+7.
56396 XOR (IX+7)
56399 LD (IX+7),A
56402 RET Return.
Prev: 56358 Up: Map Next: 56403