Prev: C868 Up: Map Next: C891
C880: Keep a speed between -3 and 2
Used by the routines at hit_block, bounce_45_negate and bounce_shallow_negate.
Used by the object routines (hit_block, bounce_45_negate and bounce_shallow_negate) on a speed's whole part.
Input
H The whole part of the speed
clamp_object_speed C880 LD A,H Negative: -1 and -2 stand, anything less becomes -3.
C881 BIT 7,A
C883 JR Z,clamp_object_speed_0
C885 CP $FE
C887 RET NC
C888 LD H,$FD
C88A RET
clamp_object_speed_0 C88B CP $02 Positive: 0 and 1 stand, anything more becomes 2.
C88D RET C
C88E LD H,$02
C890 RET
Prev: C868 Up: Map Next: C891