Prev: 51910 Up: Map Next: 51971
51946: Show Firing Pose
Used by the routine at HandleSheriff.
Changes the middle sprite of SheriffSpriteList to a firing pose while FireTimer is not zero. Type 21 is left as it is. Bit 2 of the walking frame chooses sprite 22 or 27.
Input
IX The address of the sheriff
Return unless the sheriff on foot has just fired.
ShowFiringPose 51946 LD A,(41541) Return if FireTimer is zero.
51949 AND A
51950 RET Z
51951 LD A,(IX+0) Fetch the type.
51954 CP 21 Return if the type is 21.
51956 RET Z
Choose the firing torso from bit 2 of the walking frame.
51957 BIT 2,(IX+12) Test bit 2 of the walking frame.
51961 LD A,22 Use sprite 22.
51963 JR Z,ShowFiringPose_Store Jump to ShowFiringPose_Store if bit 2 is not set.
51965 ADD A,5 Add 5.
Store it as the middle sprite of SheriffSpriteList.
ShowFiringPose_Store 51967 LD (41517),A Set the middle sprite of SheriffSpriteList and return.
51970 RET
Prev: 51910 Up: Map Next: 51971