.SpawnRock STMFD R13!, {R6-R9, R14} \ Store the registers that we want to use on \ the stack so they can be preserved \ Drop a rock from the sky, spawning the \ rock at coordinates (R0, R1, R2), which \ are set to half the height of a normal \ rock and PLAYER_FRONT_Z tiles forwards \ from the camera coordinates, which is \ fairly high in the sky above the ship's \ current position and one tile in front of \ the ship LDR R0, [R11, #xCamera] \ Set R0 = xCamera MVN R1, #ROCK_HEIGHT / 2 \ Set R1 = ~ROCK_HEIGHT / 2 \ = -(ROCK_HEIGHT + 1) / 2 LDR R2, [R11, #zCamera] \ Set R2 = zCamera - PLAYER_FRONT_Z SUB R2, R2, #PLAYER_FRONT_Z BL DropARockFromTheSky \ Drop a rock from the coordinates in \ (R0, R1, R2) LDMFD R13!, {R6-R9, PC} \ Retrieve the registers that we stored on \ the stack and return from the subroutineName: SpawnRock [Show more] Type: Subroutine Category: Particles Summary: An unused routine that spawns a rock in the sky, at half the altitude of the rocks in the DropRocksFromTheSky routine Deep dive: Unused code in LanderContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Subroutine DropARockFromTheSky (category: Particles)
Drop a rock from the specified coordinates by spawning it as a particle, albeit a very big particle with an associated 3D object
[X]
Configuration variable PLAYER_FRONT_Z = (TILES_Z - 5) * TILE_SIZE
The distance along the z-axis between the tile in front of the player and the camera, which is where we spawn explosions and falling rocks (set to six tiles forwards from the camera)
[X]
Configuration variable ROCK_HEIGHT = TILE_SIZE * 32
The height from which we drop rocks from the sky (32 tile sizes)
[X]
Configuration variable xCamera = &13C
The 3D x-coordinate of the camera position (though note that the camera position is actually at the back of the on-screen landscape, not the front)
[X]
Configuration variable zCamera = &144
The 3D z-coordinate of the camera position (though note that the camera position is actually at the back of the on-screen landscape, not the front, so the camera's z-coordinate is larger than it would be for a more traditional camera position; it is more like the camera's focal point than position, in a sense)