.CLYNS LDA #0 ; Set the delay in DLY to 0, to indicate that we are STA DLY ; no longer showing an in-flight message, so any new ; in-flight messages will be shown instantly STA de ; Clear de, the flag that appends " DESTROYED" to the ; end of the next text token, so that it doesn't .CLYNS2 LDA #%11111111 ; Set DTW2 = %11111111 to denote that we are not STA DTW2 ; currently printing a word LDA #%10000000 ; Set bit 7 of QQ17 to switch standard tokens to STA QQ17 ; Sentence Case LDA #21 ; Move the text cursor to row 21, near the bottom of STA YC ; the screen LDA #1 ; Move the text cursor to column 1 STA XC LDA #HI(SCBASE)+$1A ; Set the high byte of SC(1 0) to SCBASE + $1A and the STA SC+1 ; low byte to $60 LDA #$60 ; STA SC ; We know that the low byte of SCBASE is zero, so this ; sets SC(1 0) as follows: ; ; SC(1 0) = SCBASE + $1A00 + $60 ; ; Each character row in the screen bitmap is 40 ; characters wide, and each character takes up 8 bytes, ; so 21 rows takes up 21 * 40 * 8 = 6720 = $1A40 bytes, ; and the first four characters of each character row ; are the blank screen margin either side of the game ; screen (and 4 * 8 = 32 = $20), so $1A60 is the screen ; bitmap address of the start of character row 22 within ; the game area, which is where we want our three blank ; rows to appear ; ; In other words, we need to blank screen memory from ; SC(1 0) onwards, for three character rows LDX #3 ; We want to clear three text rows, so set a counter in ; X for 3 rows .CLYLOOP2 LDA #0 ; Set A = 0, which we can use to zero screen memory TAY ; Set Y = 0, so we can use it as a byte counter .CLYLOOP STA (SC),Y ; Zero the Y-th byte of SC(1 0) DEY ; Decrement the byte counter BNE CLYLOOP ; Loop back until we have zeroed a whole page of bytes ; (which corresponds to an entire character row of width ; 256 pixels, which is the width of the game screen) CLC ; We have now blanked a whole text row, so we need to LDA SC ; move to the character row below, so add 320 ($140) ADC #$40 ; to SC(1 0) to move down one pixel line, as there are STA SC ; 320 bytes in each character row in the screen bitmap LDA SC+1 ADC #1 STA SC+1 DEX ; Decrement the row counter in X BNE CLYLOOP2 ; Loop back to blank another row, until we have done the ; number of rows in X ; Fall through into SCAN to return from the subroutine ; (as the first instruction of SCAN is an RTS)Name: CLYNS [Show more] Type: Subroutine Category: Drawing the screen Summary: Clear the bottom three text rows of the space viewContext: See this subroutine in context in the source code References: This subroutine is called as follows: * dockEd calls CLYNS * EQSHP calls CLYNS * hm calls CLYNS * JMTB calls CLYNS * me2 calls CLYNS * MESS calls CLYNS * qv calls CLYNS * TT219 calls CLYNS
This routine clears some space at the bottom of the screen and moves the text cursor to column 1, row 21.
[X]
Label CLYLOOP is local to this routine
[X]
Label CLYLOOP2 is local to this routine
[X]
Variable DTW2 (category: Text)
A flag that indicates whether we are currently printing a word
[X]
Configuration variable SCBASE = $4000
The address of the screen bitmap