Prev: 65FD Up: Map Next: 6628
661D: Reduce Car X Position
Used by the routine at HandlerCar.
Continues HandlerCar when the car is moving towards lower X positions. Takes the distance away from the X position, stopping at zero.
Input
DE X position of the car
HL Distance to move
ReduceCarX 661D EX DE,HL Swap DE and HL so that HL is the X position and DE is the distance.
661E AND A Reset the carry flag.
661F SBC HL,DE HL=HL - DE.
6621 JR NC,HandlerCar_StoreX If the result is not negative then jump to HandlerCar_StoreX.
6623 LD HL,$0000 HL=0000 (stop at zero).
6626 JR HandlerCar_StoreX Jump to HandlerCar_StoreX.
Prev: 65FD Up: Map Next: 6628