Prev: AADF Up: Map Next: AB48
AB2F: Initialise Debris
Used by the routine at FinishTeleport.
Save the X and Y of the 10 debris particles at Debris_Particles into the template at Debris_Defaults.
Copy the X and Y of each particle into the template.
InitialiseDebris AB2F LD HL,$AA4B HL=Debris_Particles.
AB32 LD DE,$AADF DE=Debris_Defaults.
AB35 LD B,$10 Set a particle counter in B for 10 loops.
InitialiseDebris_Loop AB37 LD A,(HL) Copy the particle X.
AB38 INC HL
AB39 LD (DE),A Write it and move on.
AB3A INC DE
AB3B LD A,(HL) Copy the particle Y.
AB3C INC HL
AB3D LD (DE),A Write it and move on.
AB3E INC DE
Skip the velocity and colour bytes of both records.
AB3F INC HL Skip the rest of this particle record.
AB40 INC HL
AB41 INC HL
AB42 INC DE Skip the rest of this template record.
AB43 INC DE
AB44 INC DE
AB45 DJNZ InitialiseDebris_Loop Decrease the particle counter by one and loop back to InitialiseDebris_Loop until all 10 are copied.
AB47 RET Return.
Prev: AADF Up: Map Next: AB48