Skip to navigation

Elite on the BBC Micro and NES

Tactics: FRMIS

[Elite-A, Parasite]

Name: FRMIS [Show more] Type: Subroutine Category: Tactics Summary: Fire a missile from our ship
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * Main flight loop (Part 3 of 16) calls FRMIS

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 DEC NOMSL \ Reduce the number of missiles we have by 1 JSR msblob \ Reset the dashboard's missile indicators so none of \ them are targeted, returning with Y = 0 and X = &FF STY MSAR \ The call to msblob returns Y = 0, so this sets MSAR \ to 0 to indicate that the leftmost missile is no \ longer seeking a target lock STX MSTG \ The call to msblob returns X = &FF, so this resets the \ missile so that it is no longer locked on a target JMP n_sound30 \ Call n_sound30 to make the sound of a missile launch, \ returning from the subroutine using a tail call