.TTX66 JSR MT2 \ Switch to Sentence Case when printing extended tokens JSR PBZE \ Reset the pixel buffer size in PBUP JSR HBZE \ Reset the horizontal line buffer size in HBUP STZ LBUP \ Reset the line buffer size at LBUP STZ LSP \ Reset the ball line heap pointer at LSP LDA #%10000000 \ Set bit 7 of QQ17 to switch to Sentence Case STA QQ17 STA DTW2 \ Set bit 7 of DTW2 to indicate we are not currently \ printing a word JSR FLFLLS \ Call FLFLLS to reset the LSO block LDA #YELLOW \ Send a #SETCOL YELLOW command to the I/O processor to JSR DOCOL \ switch to colour 2, which is yellow STZ LAS2 \ Set LAS2 = 0 to stop any laser pulsing STZ DLY \ Set the delay in DLY to 0, to indicate that we are \ no longer showing an in-flight message, so any new \ in-flight messages will be shown instantly STZ de \ Clear de, the flag that appends " DESTROYED" to the \ end of the next text token, so that it doesn't LDA #11 \ Send control code 11 to OSWRCH, to instruct the I/O JSR OSWRCH \ processor to clear the top part of the screen LDX QQ22+1 \ Fetch into X the number that's shown on-screen during \ the hyperspace countdown BEQ OLDBOX \ If the counter is zero then we are not counting down \ to hyperspace, so jump to OLDBOX to skip the next \ instruction JSR ee3 \ Print the 8-bit number in X at text location (0, 1), \ i.e. print the hyperspace countdown in the top-left \ corner .OLDBOX LDA #1 \ Move the text cursor to column 1 JSR DOYC LDA QQ11 \ If this is not a space view, jump to tt66 to skip BNE tt66 \ displaying the view name LDA #11 \ Move the text cursor to row 11 JSR DOXC LDA #CYAN \ Send a #SETCOL CYAN command to the I/O processor to JSR DOCOL \ switch to colour 3, which is cyan in the space view LDA VIEW \ Load the current view into A: \ \ 0 = front \ 1 = rear \ 2 = left \ 3 = right ORA #&60 \ OR with &60 so we get a value of &60 to &63 (96 to 99) JSR TT27 \ Print recursive token 96 to 99, which will be in the \ range "FRONT" to "RIGHT" JSR TT162 \ Print a space LDA #175 \ Print recursive token 15 ("VIEW ") JSR TT27 .tt66 LDA #1 \ Move the text cursor to column 1, row 1 JSR DOXC JSR DOYC LDX #0 \ Set QQ17 = 0 to switch to ALL CAPS STX QQ17 RTS \ Return from the subroutine .BOX LDA #YELLOW \ Send a #SETCOL YELLOW command to the I/O processor to JSR DOCOL \ switch to colour 2, which is yellow LDX #0 \ Set QQ17 = 0 to switch to ALL CAPS STX QQ17 STX X1 \ Set (X1, Y1) to (0, 0) STX Y1 STX Y2 \ Set Y2 = 0 DEX \ Set X2 = 255 STX X2 JSR LL30 \ Draw a line from (X1, Y1) to (X2, Y2), so that's \ (0, 0) to (255, 0), along the very top of the screen LDA #2 \ Set X1 = X2 = 2 STA X1 STA X2 JSR BOS2 \ Call BOS2 below, which will call BOS1 twice, and then \ fall through into BOS2 again, so we effectively do \ BOS1 four times, decrementing X1 and X2 each time \ before calling LOIN, so this whole loop-within-a-loop \ mind-bender ends up drawing these four lines: \ \ (1, 0) to (1, 191) \ (0, 0) to (0, 191) \ (255, 0) to (255, 191) \ (254, 0) to (254, 191) \ \ So that's a 2-pixel wide vertical border along the \ left edge of the upper part of the screen, and a \ 2-pixel wide vertical border along the right edge .BOS2 JSR BOS1 \ Call BOS1 below and then fall through into it, which \ ends up running BOS1 twice. This is all part of the \ loop-the-loop border-drawing mind-bender explained \ above .BOS1 LDA #0 \ Set Y1 = 0 STA Y1 LDA #2*Y-1 \ Set Y2 = 2 * #Y - 1. The constant #Y is 96, the STA Y2 \ y-coordinate of the mid-point of the space view, so \ this sets Y2 to 191, the y-coordinate of the bottom \ pixel row of the space view DEC X1 \ Decrement X1 and X2 DEC X2 JMP LL30 \ Draw a line from (X1, Y1) to (X2, Y2), and return from \ the subroutine using a tail callName: TTX66 [Show more] Type: Subroutine Category: Drawing the screen Summary: Send control code 11 to the I/O processor to clear the top part of the screen and draw a white borderContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * HFS2 calls TTX66 * TT18 calls TTX66 * DEATH calls via BOX
Clear the top part of the screen (the space view) and draw a white border along the top and sides.
Other entry points: BOX Just draw the border and (if this is a space view) the view name. This can be used to remove the border and view name, as it is drawn using EOR logic
[X]
Label BOS1 is local to this routine
[X]
Label BOS2 is local to this routine
[X]
Configuration variable CYAN = %11111111
Four mode 1 pixels of colour 3 (cyan or white)
[X]
Subroutine DOCOL (category: Text)
Set the text colour by sending a #SETCOL command to the I/O processor
[X]
Subroutine DOXC (category: Text)
Move the text cursor to a specified column by sending a #SETXC command to the I/O processor
[X]
Subroutine DOYC (category: Text)
Move the text cursor to a specified row by sending a #SETYC command to the I/O processor
[X]
Variable DTW2 (category: Text)
A flag that indicates whether we are currently printing a word
[X]
Subroutine FLFLLS (category: Drawing suns)
Reset the sun line heap
[X]
Subroutine HBZE (category: Drawing lines)
Reset the horizontal line buffer
[X]
Subroutine LL30 (category: Drawing lines)
Draw a one-segment line by sending an OSWRCH 129 command to the I/O processor
[X]
The ball line heap pointer, which contains the number of the first free byte after the end of the LSX2 and LSY2 heaps (see the deep dive on The ball line heap for details)
[X]
Subroutine MT2 (category: Text)
Switch to Sentence Case when printing extended tokens
[X]
Label OLDBOX is local to this routine
[X]
Configuration variable OSWRCH = &FFEE
The address for the OSWRCH routine
[X]
Subroutine PBZE (category: Drawing pixels)
Reset the pixel buffer
[X]
Subroutine TT162 (category: Text)
Print a space
[X]
Subroutine TT27 (category: Text)
Print a text token
[X]
Configuration variable Y = 96
The centre y-coordinate of the 256 x 192 space view
[X]
Configuration variable YELLOW = %00001111
Four mode 1 pixels of colour 1 (yellow)
[X]
Subroutine ee3 (category: Flight)
Print the hyperspace countdown in the top-left of the screen
[X]
Label tt66 is local to this routine