Prev: E860 Up: Map Next: E895
E880: Decrease Maroc's horizontal movement speed
Used by the routine at E852.
Input
C Maroc's horizontal movement speed (stored at EB04)
When left/right control keys are released, Maroc will slow his horizontal movement, eventually coming to a stop.
E880 LD A,C Get Maroc's horizontal movement speed
E881 CP $00 Is he moving left or right?
E883 JR Z,$E895 If Maroc is not moving horizontally left or right, skip to next routine
E885 SRA A Calculate 1/4 of Maroc's current speed
E887 SRA A
E889 NEG This value will be added to the speed, so NEG will ensure the adjustment is subtracted
E88B CP $00 Check if this means Maroc has stopped moving left/right
E88D JR NZ,$E891
E88F LD C,$00 ...If so, set speed offset to zero
E891 ADD A,C ...Otherwise, reduce current speed by 1/4
This entry point is used by the routine at E860.
E892 LD ($EB04),A Store Maroc's adjusted horizontal movement speed
Prev: E860 Up: Map Next: E895