Prev: 52836 Up: Map Next: 52921
52850: Compute Entity Approach Position
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 52850 LD E,A Skip the extended scaling step if the approach is not in phase 5.
52851 LD A,(50431)
52854 CP 5
52856 LD A,E
52857 JP NZ,Compute_Entity_Approach_Position_Short
52860 SLA A Scale the approach velocity into the displacement byte.
52862 SLA A
52864 SLA A
52866 SLA A
52868 RR D
52870 SLA A
52872 RR D
52874 SLA A
52876 RR D
52878 SLA A
52880 RR D
52882 SLA A
52884 RR D
52886 SRL D Halve the displacement three times to normalise the scale.
52888 SRL D
52890 SRL D
52892 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 52893 RRA Deinterleave the packed approach position bytes.
52894 RRA
52895 RR D
52897 RRA
52898 RR E
52900 RRA
52901 RR D
52903 RRA
52904 RR E
52906 XOR A Reassemble the screen position components via left rotation.
52907 RL D
52909 RLA
52910 RL E
52912 RLA
52913 RL D
52915 RLA
52916 RL E
52918 RLA
52919 RET Return.
52920 RET Return.
Prev: 52836 Up: Map Next: 52921