![]() |
Routines |
| Prev: 45523 | Up: Map | Next: 45583 |
|
Add the horizontal speed to the fractional X accumulator in *IX+16 (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+17 and continues at TickThenExplode_AddY.
|
||||||||||
|
Add the speed to the fraction and keep the carry as the step.
|
||||||||||
| AdvanceAnimation | 45545 | ADD A,(IX+16) | A+=*IX+16. | |||||||
| 45548 | LD C,A | C=A. | ||||||||
| 45549 | AND %00001110 | Keep only bits 1-3. | ||||||||
| 45551 | LD (IX+16),A | Write A to *IX+16. | ||||||||
|
Rotate the carry bits of the sum down to make the whole step.
|
||||||||||
| 45554 | LD A,C | Copy the sum into A. | ||||||||
| 45555 | RRCA | Rotate the high nibble down into bits 0-3. | ||||||||
| 45556 | RRCA | |||||||||
| 45557 | RRCA | |||||||||
| 45558 | RRCA | |||||||||
| 45559 | AND %00001111 | Keep only bits 0-3. | ||||||||
| 45561 | LD B,0 | Clear B. | ||||||||
| 45563 | JR TickThenExplode_AddX | Jump to TickThenExplode_AddX. | ||||||||
|
Add the vertical thrust to the Y fraction in the same way.
|
||||||||||
| AdvanceAnimation_AddYNibble | 45565 | ADD A,(IX+17) | Add the Y nibble. | |||||||
| 45568 | LD C,A | Stash the sum in C. | ||||||||
| 45569 | AND %00001111 | Keep only bits 0-3. | ||||||||
| 45571 | LD (IX+17),A | Write it back as the Y nibble. | ||||||||
| 45574 | LD A,C | Copy the sum into A. | ||||||||
| 45575 | RRCA | Rotate the high nibble down into bits 0-3. | ||||||||
| 45576 | RRCA | |||||||||
| 45577 | RRCA | |||||||||
| 45578 | RRCA | |||||||||
| 45579 | AND %00001111 | Keep only bits 0-3. | ||||||||
| 45581 | JR TickThenExplode_AddY | Jump to TickThenExplode_AddY. | ||||||||
| Prev: 45523 | Up: Map | Next: 45583 |