Skip to navigation

Elite on the BBC Micro and NES

Dashboard: ABORT2

[NES version, Bank 0]

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 active 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 pattern number for the new missile indicator: * 133 = no missile indicator * 109 = red (armed and locked) * 108 = black (disarmed) The armed missile flashes black and red, so the tile is swapped between 108 and 109 in the main loop
.ABORT2 STX MSTG ; Store the target of our missile lock in MSTG SETUP_PPU_FOR_ICON_BAR ; If the PPU has started drawing the icon bar, configure ; the PPU to use nametable 0 and pattern table 0 LDX NOMSL ; Call MSBAR to update the active indicator in the JSR MSBAR ; dashboard's missile bar, which returns with Y = 0 JMP UpdateIconBar_b3 ; Update the icon bar so the missile button shows the ; correct available option for the active missile, ; returning from the subroutine using a tail call .msbpars EQUB 4, 0, 0, 0, 0 ; These bytes appear to be unused (they are left over ; from the 6502 Second Processor version of Elite)