![]() |
Routines |
| Prev: 28019 | Up: Map | Next: 28160 |
|
Used by the routine at HandlerAccelerate.
Moves the car to a lower Y position. If it would go below the start of the map then it bounces off the edge instead.
|
||||
| SubtractY | 28143 | EX DE,HL | HL=Y position. | |
| 28144 | AND A | Subtract the result of the multiplication from the Y position. | ||
| 28145 | SBC HL,DE | |||
| 28147 | SBC A,0 | Borrow from the top byte. | ||
| 28149 | JR NZ,HandlerAccelerate_StoreY | Jump to HandlerAccelerate_StoreY if the top byte is not zero. | ||
| 28151 | EX AF,AF' | Switch to the shadow flags. | ||
| 28152 | LD A,H | A=H. | ||
| 28153 | CP 128 | Jump to BounceY if the position is below 128 in the second byte. | ||
| 28155 | JR C,BounceY | |||
| 28157 | EX AF,AF' | Switch back. | ||
| 28158 | JR HandlerAccelerate_StoreY | Jump to HandlerAccelerate_StoreY. | ||
| Prev: 28019 | Up: Map | Next: 28160 |