Prev: 26141 Up: Map Next: 26163
26152: Reduce Car Y Position
Used by the routine at HandlerCar.
Continues HandlerCar when the car is moving towards lower Y positions. Takes the distance away from the Y position, stopping at zero.
Input
DE Y position of the car
HL Distance to move
ReduceCarY 26152 EX DE,HL Swap DE and HL so that HL is the Y position and DE is the distance.
26153 AND A Reset the carry flag.
26154 SBC HL,DE HL=HL - DE.
26156 JR NC,HandlerCar_StoreY If the result is not negative then jump to HandlerCar_StoreY.
26158 LD HL,0 HL=0000 (stop at zero).
26161 JR HandlerCar_StoreY Jump to HandlerCar_StoreY.
Prev: 26141 Up: Map Next: 26163