This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
.nWqName: nWq Type: Subroutine Category: Stardust Summary: Create a random cloud of stardust
Create a random cloud of stardust containing the correct number of dust particles, i.e. NOSTM of them, which is 3 in witchspace and 18 (#NOST) in normal space. Also clears the scanner and initialises the LSO block. This is called by the DEATH routine when it displays our untimely demise.
This variation is blank in the Cassette, Disc (flight), 6502 Second Processor and Electron versions.
LDA #DUST \ Switch to stripe 3-2-3-2, which is cyan/red in the STA COL \ space view
The Electron version has no witchspace, so the number of stardust particles shown is always the same, so the value is hard-coded rather than needing to use a location (which the other versions need so they can vary the number of particles when in witchspace).
Tap on a block to expand it, and tap it again to revert.
.SAL4 JSR DORND \ Set A and X to random numbers ORA #8 \ Set A so that it's at least 8 STA SZ,Y \ Store A in the Y-th particle's z_hi coordinate at \ SZ+Y, so the particle appears in front of us STA ZZ \ Set ZZ to the particle's z_hi coordinate JSR DORND \ Set A and X to random numbers STA SX,Y \ Store A in the Y-th particle's x_hi coordinate at \ SX+Y, so the particle appears in front of us STA X1 \ Set X1 to the particle's x_hi coordinate JSR DORND \ Set A and X to random numbers STA SY,Y \ Store A in the Y-th particle's y_hi coordinate at \ SY+Y, so the particle appears in front of us STA Y1 \ Set Y1 to the particle's y_hi coordinate JSR PIXEL2 \ Draw a stardust particle at (X1,Y1) with distance ZZ DEY \ Decrement the counter to point to the next particle of \ stardust BNE SAL4 \ Loop back to SAL4 until we have randomised all the \ stardust particles
This variation is blank in the Cassette, Disc (flight) and Electron versions.
Tap on a block to expand it, and tap it again to revert.
\ Fall through into WPSHPS to clear the scanner and \ reset the LSO block