.MESS PHA ; Store A on the stack so we can restore it after the ; following LDA #16 ; Set A = 16 to use as the text row for the message if ; this is a space view LDX QQ11 ; If this is the space view, skip the following BEQ infrontvw ; instruction JSR CLYNS ; Clear the bottom three text rows of the upper screen, ; and move the text cursor to the first cleared row LDA #25 ; Set A = 25 to use as the text row for the message if ; this is not a space view EQUB $2C ; Skip the next instruction by turning it into ; $2C $85 $33, or BIT $3385, which does nothing apart ; from affect the flags .infrontvw STA YC ; Move the text cursor to the row specified in A LDX #0 ; Set QQ17 = 0 to switch to ALL CAPS STX QQ17 LDA messXC ; Move the text cursor to column messXC, in case we JSR DOXC ; jump to me1 below to erase the current in-flight ; message (whose column we stored in messXC when we ; called MESS to put it there in the first place) PLA ; Restore A from the stack LDY #20 ; Set Y = 20 for setting the message delay below CPX DLY ; If the message delay in DLY is not zero, jump up to BNE me1 ; me1 to erase the current message first (whose token ; number will be in MCH) STY DLY ; Set the message delay in DLY to 20 STA MCH ; Set MCH to the token we are about to display ; Before we fall through into mes9 to print the token, ; we need to work out the starting column for the ; message we want to print, so it's centred on-screen, ; so the following doesn't print anything, it just uses ; the justified text mechanism to work out the number of ; characters in the message we are going to print LDA #%11000000 ; Set the DTW4 flag to %11000000 (justify text, buffer STA DTW4 ; entire token including carriage returns) LDA de ; Set the C flag to bit 1 of the destruction flag in de LSR A LDA #0 ; Set A = 0 BCC P%+4 ; If the destruction flag in de is not set, skip the ; following instruction LDA #10 ; Set A = 10 STA DTW5 ; Store A in DTW5, so DTW5 (which holds the size of the ; justified text buffer at BUF) is set to 0 if the ; destruction flag is not set, or 10 if it is (10 being ; the number of characters in the " DESTROYED" token) LDA MCH ; Call TT27 to print the token in MCH into the buffer JSR TT27 ; (this doesn't print it on-screen, it just puts it into ; the buffer and moves the DTW5 pointer along, so DTW5 ; now contains the size of the message we want to print, ; including the " DESTROYED" part if that's going to be ; included) LDA #32 ; Set A = (32 - DTW5) / 2 SEC ; SBC DTW5 ; so A now contains the column number we need to print LSR A ; our message at for it to be centred on-screen (as ; there are 32 columns) STA messXC ; Store A in messXC, so when we erase the message via ; the branch to me1 above, messXC will tell us where to ; print it JSR DOXC ; Move the text cursor to column messXC JSR MT15 ; Call MT15 to switch to left-aligned text when printing ; extended tokens disabling the justify text setting we ; set above LDA MCH ; Set MCH to the token we are about to display ; Fall through into mes9 to print the token in AName: MESS [Show more] Type: Subroutine Category: Flight Summary: Display an in-flight messageContext: See this subroutine in context in the source code References: This subroutine is called as follows: * EXNO2 calls MESS * FR1 calls MESS * Ghy 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 * me2 calls MESS * ou2 calls MESS * ou3 calls MESS * OUCH calls MESS * SFRMIS 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
[X]
Subroutine CLYNS (category: Drawing the screen)
Clear the bottom three text rows of the space view
[X]
Subroutine DOXC (category: Text)
Move the text cursor to a specific column
[X]
Variable DTW4 (category: Text)
Flags that govern how justified extended text tokens are printed
[X]
Variable DTW5 (category: Text)
The size of the justified text buffer at BUF
[X]
Subroutine MT15 (category: Text)
Switch to left-aligned text when printing extended tokens
[X]
Subroutine TT27 (category: Text)
Print a text token
[X]
Label infrontvw is local to this routine
[X]
Subroutine me1 (category: Flight)
Erase an old in-flight message and display a new one