Skip to navigation


Particles: AddBulletParticleToBuffer

Name: AddBulletParticleToBuffer [Show more] Type: Subroutine Category: Particles Summary: Add a bullet particle to the particle data buffer Deep dive: Particles and particle clouds Collisions and bullets
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MoveAndDrawPlayer (Part 5 of 5) calls AddBulletParticleToBuffer

Arguments: (R0, R1, R2) Particle coordinate (R3, R4, R5) Particle velocity R6 Particle lifespan counter (i.e. how many iterations around the main loop before the particle expires) R7 Particle flags R8 Magnitude of the random element that's added to the velocity, with a larger figure giving a smaller random element; the actual range is +/- 2^(32 - R8) R9 Magnitude of the random element that's added to the particle lifespan, with a larger figure giving a smaller random element; the actual range is 0 to 2^(32 - R9)
.AddBulletParticleToBuffer STMFD R13!, {R8, R14} \ Store R8 and the return address on the \ stack, so the call to StoreParticleData \ can return properly B StoreParticleData \ Jump to StoreParticleData to store the \ particle in the particle data buffer, \ returning from the subroutine using a tail \ call