Skip to navigation


Particles: SplashParticleIntoSea

Name: SplashParticleIntoSea [Show more] Type: Subroutine Category: Particles Summary: Splash a particle into the sea, creating a spray particle Deep dive: Particles and particle clouds
Context: 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
.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 sea