Prev: B7DA Up: Map Next: B810
B7F0: 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 06 of the object hold the direction.
Input
IX The address of the object
Choose the frame from the direction and the view.
SetFrameAndFlip B7F0 LD A,($A268) Fetch the view number and keep it in B.
B7F3 LD B,A
B7F4 LD A,(IX+$06) Fetch the direction.
B7F7 SUB $40 Take one off the direction.
B7F9 RLCA Move bit 7 into bit 0.
B7FA AND %00000001 Keep bit 0.
B7FC XOR B Combine it with the view.
B7FD LD (IX+$0C),A Set the frame.
Set the flip bit from the direction.
B800 LD A,(IX+$06) Fetch the direction.
B803 AND %01000000 Keep bit 6.
B805 LD C,A Keep the flip bit in C.
B806 LD A,(IX+$07) Fetch the flags.
B809 AND %10111111 Clear bit 6.
B80B OR C Set bit 6 if the direction says so.
B80C LD (IX+$07),A Store the flags.
B80F RET Return.
Prev: B7DA Up: Map Next: B810