![]() |
Routines |
| Prev: B1D3 | Up: Map | Next: B20F |
|
Add the horizontal speed to the fractional X accumulator in *IX+10 (bits 1-3 only) and add the carried step to the world X at TickThenExplode_AddX. AdvanceAnimation_AddYNibble does the same for the vertical thrust, using *IX+11 and continues at TickThenExplode_AddY.
|
||||||||||
|
Add the speed to the fraction and keep the carry as the step.
|
||||||||||
| AdvanceAnimation | B1E9 | ADD A,(IX+$10) | A+=*IX+10. | |||||||
| B1EC | LD C,A | C=A. | ||||||||
| B1ED | AND %00001110 | Keep only bits 1-3. | ||||||||
| B1EF | LD (IX+$10),A | Write A to *IX+10. | ||||||||
|
Rotate the carry bits of the sum down to make the whole step.
|
||||||||||
| B1F2 | LD A,C | Copy the sum into A. | ||||||||
| B1F3 | RRCA | Rotate the high nibble down into bits 0-3. | ||||||||
| B1F4 | RRCA | |||||||||
| B1F5 | RRCA | |||||||||
| B1F6 | RRCA | |||||||||
| B1F7 | AND %00001111 | Keep only bits 0-3. | ||||||||
| B1F9 | LD B,$00 | Clear B. | ||||||||
| B1FB | JR TickThenExplode_AddX | Jump to TickThenExplode_AddX. | ||||||||
|
Add the vertical thrust to the Y fraction in the same way.
|
||||||||||
| AdvanceAnimation_AddYNibble | B1FD | ADD A,(IX+$11) | Add the Y nibble. | |||||||
| B200 | LD C,A | Stash the sum in C. | ||||||||
| B201 | AND %00001111 | Keep only bits 0-3. | ||||||||
| B203 | LD (IX+$11),A | Write it back as the Y nibble. | ||||||||
| B206 | LD A,C | Copy the sum into A. | ||||||||
| B207 | RRCA | Rotate the high nibble down into bits 0-3. | ||||||||
| B208 | RRCA | |||||||||
| B209 | RRCA | |||||||||
| B20A | RRCA | |||||||||
| B20B | AND %00001111 | Keep only bits 0-3. | ||||||||
| B20D | JR TickThenExplode_AddY | Jump to TickThenExplode_AddY. | ||||||||
| Prev: B1D3 | Up: Map | Next: B20F |