Skip to navigation

Elite on the BBC Micro and NES

Version analysis of FRMIS

This code appears in the following versions (click to see it in the source code):

Code variations between these versions are shown below.

Name: FRMIS Type: Subroutine Category: Tactics Summary: Fire a missile from our ship
We fired a missile, so send it streaking away from us to unleash mayhem and destruction on our sworn enemies.
.FRMIS LDX #MSL \ Call FRS1 to launch a missile straight ahead of us JSR FRS1 BCC FR1 \ If FRS1 returns with the C flag clear, then there \ isn't room in the universe for our missile, so jump \ down to FR1 to display a "missile jammed" message LDX MSTG \ Fetch the slot number of the missile's target JSR GINF \ Get the address of the data block for the target ship \ and store it in INF LDA FRIN,X \ Fetch the ship type of the missile's target into A JSR ANGRY \ Call ANGRY to make the target ship hostile

Code variation 1 of 2Specific to an individual platform

Tap on a block to expand it, and tap it again to revert.

LDY #0 \ We have just launched a missile, so we need to remove JSR ABORT \ missile lock and hide the leftmost indicator on the \ dashboard by setting it to black (Y = 0)
LDY #&04 \ We have just launched a missile, so we need to remove JSR ABORT \ missile lock and hide the leftmost indicator on the \ dashboard by setting it to black (Y = &04)
 DEC NOMSL              \ Reduce the number of missiles we have by 1

Code variation 2 of 2Specific to an individual platform

Tap on a block to expand it, and tap it again to revert.

LDA #48 \ Call the NOISE routine with A = 48 to make the sound JMP NOISE \ of a missile launch, returning from the subroutine \ using a tail call
LDY #solaun \ Call the NOISE routine with Y = 8 to make the sound JSR NOISE \ of a missile launch \ Fall through into ANGRY to make the missile target \ angry, though as we already did this above, I'm not \ entirely sure why we do this again