![]() |
Routines |
| Prev: CE64 | Up: Map | Next: CEB9 |
|
Used by the routine at Main_Game_Loop.
Computes the approach position and frame index for an intro entity. Entry at Compute_Entity_Approach_Position_Short skips the phase-5 scaling step. Both entry points are called from Main_Game_Loop.
|
||||
| Compute_Entity_Approach_Position | CE72 | LD E,A | Skip the extended scaling step if the approach is not in phase 05. | |
| CE73 | LD A,($C4FF) | |||
| CE76 | CP $05 | |||
| CE78 | LD A,E | |||
| CE79 | JP NZ,Compute_Entity_Approach_Position_Short | |||
| CE7C | SLA A | Scale the approach velocity into the displacement byte. | ||
| CE7E | SLA A | |||
| CE80 | SLA A | |||
| CE82 | SLA A | |||
| CE84 | RR D | |||
| CE86 | SLA A | |||
| CE88 | RR D | |||
| CE8A | SLA A | |||
| CE8C | RR D | |||
| CE8E | SLA A | |||
| CE90 | RR D | |||
| CE92 | SLA A | |||
| CE94 | RR D | |||
| CE96 | SRL D | Halve the displacement three times to normalise the scale. | ||
| CE98 | SRL D | |||
| CE9A | SRL D | |||
| CE9C | LD A,D | Transfer the normalised displacement to A. | ||
|
This entry point is used by the routine at Main_Game_Loop.
|
||||
| Compute_Entity_Approach_Position_Short | CE9D | RRA | Deinterleave the packed approach position bytes. | |
| CE9E | RRA | |||
| CE9F | RR D | |||
| CEA1 | RRA | |||
| CEA2 | RR E | |||
| CEA4 | RRA | |||
| CEA5 | RR D | |||
| CEA7 | RRA | |||
| CEA8 | RR E | |||
| CEAA | XOR A | Reassemble the screen position components via left rotation. | ||
| CEAB | RL D | |||
| CEAD | RLA | |||
| CEAE | RL E | |||
| CEB0 | RLA | |||
| CEB1 | RL D | |||
| CEB3 | RLA | |||
| CEB4 | RL E | |||
| CEB6 | RLA | |||
| CEB7 | RET | Return. | ||
| CEB8 | RET | Return. | ||
| Prev: CE64 | Up: Map | Next: CEB9 |