This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
.ESCAPEName: ESCAPE Type: Subroutine Category: Flight Summary: Launch our escape pod
This routine displays our doomed Cobra Mk III disappearing off into the ether before arranging our replacement ship. Called when we press ESCAPE during flight and have an escape pod fitted.
In the cassette version, launching an escape pod in witchspace is immediately fatal, while in the disc version it launches properly. In the advanced versions, meanwhile, the launch key is disabled as soon as you enter witchspace.
See below for more variations related to this code.
This variation is blank in the Disc (flight), 6502 Second Processor, Master and Electron versions.
LDA MJ \ Store the value of MJ on the stack (the "are we in PHA \ witchspace?" flag)
JSR RES2 \ Reset a number of flight variables and workspaces
When you launch an escape pod in the Electron version, you don't see an animation of your Cobra Mk III drifting away, but jump straight into the station.
See below for more variations related to this code.
This variation is blank in the Electron version.
LDX #CYL \ Set the current ship type to a Cobra Mk III, so we STX TYPE \ can show our ship disappear into the distance when we \ eject in our pod JSR FRS1 \ Call FRS1 to launch the Cobra Mk III straight ahead, \ like a missile launch, but with our ship instead
When trying to spawn a Cobra Mk III to display when we use an escape pod, the enhanced versions will first try to spawn a normal Cobra, and if that fails, they will try again with a pirate Cobra.
This variation is blank in the Cassette and Electron versions.
Code variation 4 of 11
See variation 2 above for details.
This variation is blank in the Electron version.
LDA #8 \ Set the Cobra's byte #27 (speed) to 8 STA INWK+27 LDA #194 \ Set the Cobra's byte #30 (pitch counter) to 194, so it STA INWK+30 \ pitches up as we pull away LSR A \ Set the Cobra's byte #32 (AI flag) to %01100001, so it STA INWK+32 \ has no AI, and we can use this value as a counter to \ do the following loop 97 times
.ESL1
Code variation 5 of 11
See variation 2 above for details.
This variation is blank in the Electron version.
JSR MVEIT \ Call MVEIT to move the Cobra in space
In the Master version, if you launch your escape pod while looking out of the side or rear views, you won't see your Cobra as you leave it behind, while in the other versions you do.
This variation is blank in the Cassette, Disc (flight), 6502 Second Processor and Electron versions.
LDA QQ11 \ If either of QQ11 or VIEW is non-zero (i.e. this is ORA VIEW \ not the front space view), skip the following BNE P%+5 \ instruction
Code variation 7 of 11
See variation 2 above for details.
This variation is blank in the Electron version.
JSR LL9 \ Call LL9 to draw the Cobra on-screen DEC INWK+32 \ Decrement the counter in byte #32 BNE ESL1 \ Loop back to keep moving the Cobra until the AI flag \ is 0, which gives it time to drift away from our pod JSR SCAN \ Call SCAN to remove the Cobra from the scanner (by \ redrawing it)
Code variation 8 of 11
See variation 1 above for details.
Tap on a block to expand it, and tap it again to revert.
LDX #16 \ We lose all our cargo when using our escape pod, so \ up a counter in X so we can zero the 17 cargo slots \ in QQ20 .ESL2
DEX \ Decrement the counter BPL ESL2 \ Loop back to ESL2 until we have emptied the entire \ cargo hold STA FIST \ Launching an escape pod also clears our criminal \ record, so set our legal status in FIST to 0 ("clean") STA ESCP \ The escape pod is a one-use item, so set ESCP to 0 so \ we no longer have one fitted
This variation is blank in the Cassette, Disc (flight), 6502 Second Processor and Electron versions.
\LDA TRIBBLE \ These instructions are commented out in the original \ORA TRIBBLE+1 \ source \BEQ nosurviv \ \ \ They ensure that in games with the Trumble mission, \JSR DORND \ at least one Trumble will hitch a ride in the escape \AND #7 \ pod (so using an escape pod is not a solution to the \ORA #1 \ trouble with Trumbles) \STA TRIBBLE \ \LDA #0 \ This version of Elite does not contain the Trumble \STA TRIBBLE+1 \ mission, so the code is disabled \ \.nosurviv
LDA #70 \ Our replacement ship is delivered with a full tank of STA QQ14 \ fuel, so set the current fuel level in QQ14 to 70, or \ 7.0 light years