This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
.MESSName: MESS Type: Subroutine Category: Flight Summary: Display an in-flight message
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
This variation is blank in the Cassette, Disc (flight), Disc (docked) and Electron versions.
Tap on a block to expand it, and tap it again to revert.
LDX #0 \ Set QQ17 = 0 to switch to ALL CAPS STX QQ17
The original versions display in-flight messages at column 9 on row 22, at the bottom of the screen. The advanced versions go one better and centre their in-flight messages on screen, rather than always starting them at column 9.
See below for more variations related to this code.
Tap on a block to expand it, and tap it again to revert.
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)
The Master version flashes in-flight messages 10% more quickly than the other versions.
Tap on a block to expand it, and tap it again to revert.
STA MCH \ Set MCH to the token we are about to display
Code variation 4 of 6
See variation 2 above for details.
This variation is blank in the Cassette, Disc (flight), Disc (docked) and Electron versions.
\ 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
This variation is blank in the Cassette, Disc (flight), Disc (docked) and Electron versions.
Tap on a block to expand it, and tap it again to revert.
Code variation 6 of 6
See variation 2 above for details.
This variation is blank in the Cassette, Disc (flight), Disc (docked) and Electron versions.
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 A