Prev: 28185 Up: Map Next: 28227
28210: Subtract X Movement
Used by the routine at HandlerAccelerate.
Moves the car to a lower X position. If it would go below the start of the map then it bounces off the edge instead.
SubtractX 28210 EX DE,HL HL=X position.
28211 AND A Subtract the result of the multiplication from the X position.
28212 SBC HL,DE
28214 SBC A,0 Borrow from the top byte.
28216 JR NZ,HandlerAccelerate_StoreX Jump to HandlerAccelerate_StoreX if the top byte is not zero.
28218 EX AF,AF' Switch to the shadow flags.
28219 LD A,H A=H.
28220 CP 128 Jump to BounceX if the position is below 128 in the second byte.
28222 JR C,BounceX
28224 EX AF,AF' Switch back.
28225 JR HandlerAccelerate_StoreX Jump to HandlerAccelerate_StoreX.
Prev: 28185 Up: Map Next: 28227