.DeleteParticleData LDR R8, [R11, #particleEnd] \ Decrease the address of the end of the SUB R8, R8, #8*4 \ particle data buffer by eight words, so it STR R8, [R11, #particleEnd] \ points to the last particle's data in the \ buffer LDMIA R8, {R0-R7} \ Copy the eight bytes of particle data from STMIA R10, {R0-R7} \ the end of the buffer to the address in \ R10 MOV R7, #0 \ Zero the last word of the last particle's STR R7, [R8, #7*4] \ data, so the last particle in the buffer \ now acts as a null terminator LDR R8, [R11, #particleCount] \ Decrement the particle counter to reflect SUB R8, R8, #1 \ the new number of particles on-screen STR R8, [R11, #particleCount] B dpar1 \ Jump to the start of the main loop in \ MoveAndDrawParticles to process the next \ particle in the particle data bufferName: DeleteParticleData [Show more] Type: Subroutine Category: Particles Summary: Delete a particle from the particle data buffer and move the last particle's data down to take its place Deep dive: Particles and particle cloudsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * AddSmallExplosionToBuffer calls DeleteParticleData * BounceParticle calls DeleteParticleData * MoveAndDrawParticles (Part 1 of 4) calls DeleteParticleData * ProcessObjectDestruction calls DeleteParticleData * SplashParticleIntoSea calls DeleteParticleData
Arguments: R10 The address in the particle data buffer of the particle to delete
[X]
Entry point dpar1 in subroutine MoveAndDrawParticles (Part 1 of 4) (category: Particles)
The start of the main particle-processing loop
[X]
Configuration variable particleCount = &10C
The number of particles currently on-screen
[X]
Configuration variable particleEnd = &108
The address of the end of the particle data in the particle data buffer