Skip to navigation

Elite on the BBC Micro and NES

Flight: MESS

[NES version, Bank 0]

Name: MESS [Show more] Type: Subroutine Category: Flight Summary: Display an in-flight message
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * EXNO2 calls MESS * FR1 calls MESS * KILLSHP calls MESS * Main flight loop (Part 8 of 16) calls MESS * Main flight loop (Part 12 of 16) calls MESS * Main flight loop (Part 15 of 16) calls MESS * ou3 calls MESS * OUCH calls MESS * SFRMIS calls MESS * TT102 calls MESS

Display an in-flight message in capitals at the bottom of the space view, erasing any existing in-flight message first.
Arguments: A The text token to be printed
.MESS PHA ; Store A on the stack so we can restore it after the ; following 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 LDY #10 ; Set the message delay in DLY to 10 STY DLY LDA #%11000000 ; Set the DTW4 flag to %11000000 (justify text, buffer STA DTW4 ; entire token including carriage returns) LDA #0 ; Set DTW5 = 0, which sets the size of the justified STA DTW5 ; text buffer at BUF to zero PLA ; Restore A from the stack CMP #250 ; If this is not token 250 (the hyperspace countdown), BNE mess1 ; jump to mess1 to print the token in A ; This is token 250, so now we print the hyperspace ; countdown LDA #0 ; Set QQ17 = 0 to switch to ALL CAPS STA QQ17 LDA #189 ; Print recursive token 29 ("HYPERSPACE ") JSR TT27_b2 LDA #'-' ; Print a hyphen JSR TT27_b2 JSR TT162 ; Print a space 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 JSR SetSelectedSeeds ; Set the seeds for the selected system in QQ15 to the ; seeds in the safehouse LDA #3 ; Set A = 3 so we print the hyperspace countdown with ; three digits CLC ; Clear the C flag so we print the hyperspace countdown ; without a decimal point LDX QQ22+1 ; Set (Y X) = QQ22+1, which contains the number that's LDY #0 ; shown on-screen during hyperspace countdown JSR TT11 ; Print the hyperspace countdown with 3 digits and no ; decimal point JMP mes9+3 ; Jump to mes9+3 to skip the following and not print ; the message in A, as we have already printed it .mess1 PHA ; Store A on the stack so we can restore it after the ; following LDA #0 ; Set QQ17 = 0 to switch to ALL CAPS STA QQ17 PLA ; Restore A from the stack ; Fall through into mes9 to print the token in A