Skip to navigation

Elite on the BBC Micro and NES

Universe: KS4

[Acorn Electron version]

Name: KS4 [Show more] Type: Subroutine Category: Universe Summary: Remove the space station and replace with a placeholder
Context: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * KILLSHP calls KS4
.KS4 JSR ZINF \ Call ZINF to reset the INWK ship workspace LDA #0 \ Set A = 0 so we can zero the following flags STA FRIN+1 \ Set the second slot in the FRIN table to 0, which \ sets this slot to empty, so when we call NWSHP below \ the placeholder that gets created will go into FRIN+1 STA SSPR \ Set the "space station present" flag to 0, as we are \ no longer in the space station's safe zone JSR SPBLB \ Call SPBLB to redraw the space station bulb, which \ will erase it from the dashboard LDA #6 \ Set the placeholder's y_sign to 6 STA INWK+5 LDA #129 \ Set A = 129, the ship type for the placeholder, so \ there isn't a space station, but there is a non-zero \ ship type to indicate this JMP NWSHP \ Call NWSHP to set up the new data block and add it \ to FRIN, where it will get put in the second slot as \ we just cleared out the second slot, and the first \ slot is already taken by the planet