.SplashParticleIntoSea TST R7, #&00040000 \ If bit 18 of the particle flags is clear, BEQ DeleteParticleData \ jump to DeleteParticleData to delete the \ particle without splashing TST R7, #&00800000 \ If bit 23 of the particle flags is set, MOVNE R8, #65 \ set the number of spray particles in R8 MOVEQ R8, #4 \ to 65, otherwise set it to 4 SUB R1, R1, #SPLASH_HEIGHT \ Set R1 to a point just above the sea's \ surface (R1 is on the surface, so this \ moves it to SPLASH_HEIGHT above the waves, \ or 1/16 of a tile size) .psea1 BL AddSprayParticleToBuffer \ Add a spray particle to the particle data \ buffer SUBS R8, R8, #1 \ Decrement the particle counter in R8 BNE psea1 \ Loop back until we have added all the \ spray particles \ Fall through into DeleteParticleData to \ delete the particle and return from the \ subroutine, as the particle has now \ crashed into the seaName: SplashParticleIntoSea [Show more] Type: Subroutine Category: Particles Summary: Splash a particle into the sea, creating a spray particle Deep dive: Particles and particle cloudsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * BounceParticle calls SplashParticleIntoSea
Arguments: (R0, R1, R2) Particle coordinates (on the sea's surface) R7 Particle flags
[X]
Subroutine AddSprayParticleToBuffer (category: Particles)
Add a spray particle to the particle data buffer
[X]
Subroutine DeleteParticleData (category: Particles)
Delete a particle from the particle data buffer and move the last particle's data down to take its place
[X]
Configuration variable SPLASH_HEIGHT = TILE_SIZE / 16
The height above the sea at which splash particles are added when a particle splashes into the sea (1/16 of a tile)
[X]
Label psea1 is local to this routine