Skip to navigation

Elite on the BBC Micro and NES

Universe: KS1

[NES version, Bank 0]

Name: KS1 [Show more] Type: Subroutine Category: Universe Summary: Remove the current ship from our local bubble of universe
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * Main flight loop (Part 12 of 16) calls KS1 * KS2 calls via KS3

Part 12 of the main flight loop calls this routine to remove the ship that is currently being analysed by the flight loop. Once the ship is removed, it jumps back to MAL1 to rejoin the main flight loop, with X pointing to the same slot that we just cleared (and which now contains the next ship in the local bubble of universe).
Arguments: XX0 The address of the blueprint for this ship INF The address of the data block for this ship
Other entry points: KS3 Contains an RTS
.KS3 RTS ; Return from the subroutine .KS1 LDX XSAV ; Store the current ship's slot number in XSAV JSR KILLSHP ; Call KILLSHP to remove the ship in slot X from our ; local bubble of universe LDX XSAV ; Restore the current ship's slot number from XSAV, ; which now points to the next ship in the bubble RTS ; Return from the subroutine