![]() |
Routines |
| Prev: 36102 | Up: Map | Next: 36549 |
|
Set bit 2 of the actor type so Jetman faces right, then accelerate or cap the horizontal speed.
|
||||||||
|
Decrease to the 0-based sprite index, set bit 2 to face right, then write the 1-based ID back.
|
||||||||
| FaceJetmanRight | 36442 | LD A,(IX+0) | Fetch the actor type. | |||||
| 36445 | DEC A | Decrease it to a 0-based sprite index. | ||||||
| 36446 | SET 2,A | Set the facing bit. | ||||||
| 36448 | INC A | Restore the 1-based sprite ID. | ||||||
| 36449 | LD (IX+0),A | Write it back to *IX+0. | ||||||
|
Push the speed right while any fuel remains. Bit 0 of the actor flags is set while Jetman is carrying an item, which slows him down.
|
||||||||
| 36452 | BIT 0,(IX+8) | Jump to FaceJetmanRight_Carrying if Jetman is carrying an item. | ||||||
| 36456 | JR NZ,FaceJetmanRight_Carrying | |||||||
| 36458 | LD A,(IX+5) | Jump to FaceJetmanRight_ReverseLeft if the horizontal speed is negative. | ||||||
| 36461 | AND A | |||||||
| 36462 | JP M,FaceJetmanRight_ReverseLeft | |||||||
|
Settle on the slow speed if the fuel has run out.
|
||||||||
| 36465 | EX AF,AF' | Stash the speed in AF'. | ||||||
| 36466 | LD A,(24719) | Jump to FaceJetmanRight_NoFuel if FuelLevel_2 is zero. | ||||||
| 36469 | AND A | |||||||
| 36470 | JR Z,FaceJetmanRight_NoFuel | |||||||
|
Speed up to the right unless the speed is already at the cap.
|
||||||||
| 36472 | EX AF,AF' | Restore the speed. | ||||||
| 36473 | CP 64 | Jump to Handler_JetmanMovement_Read if the speed is already at least 64. | ||||||
| 36475 | JP NC,Handler_JetmanMovement_Read | |||||||
| 36478 | ADD A,8 | Add 8 to the speed. | ||||||
| 36480 | CP 48 | Jump to FaceJetmanRight_Loop if it is still less than 48. | ||||||
| 36482 | JR C,FaceJetmanRight_Loop | |||||||
| 36484 | ADD A,16 | Add a further 16 to leave the mid-band. | ||||||
|
This entry point is used by the routine at FaceJetmanLeft.
|
||||||||
| FaceJetmanRight_Loop | 36486 | JP Handler_JetmanMovement_Grounded | Jump to Handler_JetmanMovement_Grounded. | |||||
|
Reverse a leftward speed toward the right.
|
||||||||
| FaceJetmanRight_ReverseLeft | 36489 | CP 208 | Jump to FaceJetmanRight_AddStep if the speed is at least 208. | |||||
| 36491 | JR NC,FaceJetmanRight_AddStep | |||||||
| 36493 | ADD A,16 | Add 16 to the speed. | ||||||
| FaceJetmanRight_AddStep | 36495 | ADD A,8 | Add 8 to the speed. | |||||
| 36497 | JR FaceJetmanRight_Loop | Jump to FaceJetmanRight_Loop. | ||||||
|
With no fuel, settle on a slow rightward speed of 16 (signed +16).
|
||||||||
| FaceJetmanRight_NoFuel | 36499 | LD A,16 | Set a slow rightward speed of 16. | |||||
| 36501 | JR FaceJetmanRight_Loop | Jump to FaceJetmanRight_Loop. | ||||||
|
While carrying an item, use a slower rightward cap.
|
||||||||
| FaceJetmanRight_Carrying | 36503 | LD A,(IX+5) | Jump to FaceJetmanRight_CarryingClamp if the horizontal speed is negative. | |||||
| 36506 | AND A | |||||||
| 36507 | JP M,FaceJetmanRight_CarryingClamp | |||||||
|
Settle on the slow speed if the fuel has run out.
|
||||||||
| 36510 | EX AF,AF' | Stash the speed in AF'. | ||||||
| 36511 | LD A,(24719) | Jump to FaceJetmanRight_CarryingSlow if FuelLevel_2 is zero. | ||||||
| 36514 | AND A | |||||||
| 36515 | JR Z,FaceJetmanRight_CarryingSlow | |||||||
|
Speed up to the right unless the speed is already at the cap.
|
||||||||
| 36517 | EX AF,AF' | Restore the speed. | ||||||
| 36518 | CP 32 | Jump to FaceJetmanRight_CarryingFast if the speed is already at least 32. | ||||||
| 36520 | JP NC,FaceJetmanRight_CarryingFast | |||||||
| 36523 | ADD A,4 | Add 4 to the speed. | ||||||
| 36525 | JP Handler_JetmanMovement_Grounded | Jump to Handler_JetmanMovement_Grounded. | ||||||
|
Reverse a leftward speed toward the right.
|
||||||||
| FaceJetmanRight_CarryingClamp | 36528 | CP 208 | Jump to FaceJetmanRight_CarryingStep if the speed is at least 208. | |||||
| 36530 | JR NC,FaceJetmanRight_CarryingStep | |||||||
| 36532 | ADD A,16 | Add 16 to the speed. | ||||||
| FaceJetmanRight_CarryingStep | 36534 | ADD A,8 | Add 8 to the speed. | |||||
| 36536 | JP Handler_JetmanMovement_Grounded | Jump to Handler_JetmanMovement_Grounded. | ||||||
|
With no fuel while carrying an item, settle on 16 (signed +16).
|
||||||||
| FaceJetmanRight_CarryingSlow | 36539 | LD A,16 | Set a slow rightward speed of 16. | |||||
| 36541 | JP Handler_JetmanMovement_Grounded | Jump to Handler_JetmanMovement_Grounded. | ||||||
|
Cap the rightward speed at 32 while carrying an item.
|
||||||||
| FaceJetmanRight_CarryingFast | 36544 | LD A,32 | Set a rightward cap of 32. | |||||
| 36546 | JP Handler_JetmanMovement_Grounded | Jump to Handler_JetmanMovement_Grounded. | ||||||
| Prev: 36102 | Up: Map | Next: 36549 |