Skip to navigation

Elite on the BBC Micro

Dashboard: ABORT2 [Elite-A, Flight]

Name: ABORT2 [Show more] Type: Subroutine Category: Dashboard Summary: Set/unset the lock target for a missile and update the dashboard
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * Main flight loop (Part 11 of 16) calls ABORT2

Set the lock target for the leftmost missile and update the dashboard. Arguments: X The slot number of the ship to lock our missile onto, or &FF to remove missile lock Y The new colour of the missile indicator: * &00 = black (no missile) * &0E = red (armed and locked) * &E0 = yellow/white (armed) * &EE = green/cyan (disarmed)
.ABORT2 STX MSTG \ Store the target of our missile lock in MSTG \ --- Mod: Original Acornsoft code removed: -----------> \ LDX NOMSL \ Call MSBAR to update the leftmost indicator in the \ JSR MSBAR \ dashboard's missile bar, which returns with Y = 0 \ --- And replaced by: --------------------------------> LDX NOMSL \ Call MSBAR to update the leftmost indicator in the DEX \ dashboard's missile bar, by calling with X = NOMSL - 1 JSR MSBAR \ (as the missile indicators are numbered 0-3 in Elite-A \ rather than the 1-4 in the disc version) \ \ MSBAR returns with Y = 0 \ --- End of replacement ------------------------------> STY MSAR \ Set MSAR = 0 to indicate that the leftmost missile \ is no longer seeking a target lock RTS \ Return from the subroutine