Prev: 47066 Up: Map Next: 47120
47088: Set Frame And Flip
Used by the routine at HandleBystander.
Chooses the frame of a walking figure and whether its sprite is flipped, from the direction in which it is walking and the view. Bits 6 and 7 of byte 6 of the object hold the direction.
Input
IX The address of the object
Choose the frame from the direction and the view.
SetFrameAndFlip 47088 LD A,(41576) Fetch the view number and keep it in B.
47091 LD B,A
47092 LD A,(IX+6) Fetch the direction.
47095 SUB 64 Take one off the direction.
47097 RLCA Move bit 7 into bit 0.
47098 AND %00000001 Keep bit 0.
47100 XOR B Combine it with the view.
47101 LD (IX+12),A Set the frame.
Set the flip bit from the direction.
47104 LD A,(IX+6) Fetch the direction.
47107 AND %01000000 Keep bit 6.
47109 LD C,A Keep the flip bit in C.
47110 LD A,(IX+7) Fetch the flags.
47113 AND %10111111 Clear bit 6.
47115 OR C Set bit 6 if the direction says so.
47116 LD (IX+7),A Store the flags.
47119 RET Return.
Prev: 47066 Up: Map Next: 47120