Skip to navigation

Elite on the BBC Micro and NES

Drawing the screen: CLYNS

[BBC Micro disc version, Docked]

Name: CLYNS [Show more] Type: Subroutine Category: Drawing the screen Summary: Clear the bottom three text rows of the mode 4 screen
Context: 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: * EQSHP calls CLYNS * hm calls CLYNS * JMTB calls CLYNS * qv calls CLYNS * TITLE calls CLYNS * TT102 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. Specifically, it zeroes the following screen locations: &7507 to &75F0 &7607 to &76F0 &7707 to &77F0 which clears the three bottom text rows of the mode 4 screen (rows 21 to 23), clearing each row from text column 1 to 30 (so it doesn't overwrite the box border in columns 0 and 32, or the last usable column in column 31).
Returns: A A is set to 0 Y Y is set to 0
.CLYNS LDA #%11111111 \ Set DTW2 = %11111111 to denote that we are not STA DTW2 \ currently printing a word LDA #20 \ Move the text cursor to row 20, near the bottom of STA YC \ the screen JSR TT67 \ Print a newline, which will move the text cursor down \ a line (to row 21) and back to column 1 LDA #&75 \ Set the two-byte value in SC to &7507 STA SC+1 LDA #7 STA SC LDA #0 \ Call LYN to clear the pixels from &7507 to &75F0 JSR LYN INC SC+1 \ Increment SC+1 so SC points to &7607 JSR LYN \ Call LYN to clear the pixels from &7607 to &76F0 INC SC+1 \ Increment SC+1 so SC points to &7707 INY \ Move the text cursor to column 1 (as LYN sets Y to 0) STY XC \ Fall through into LYN to clear the pixels from &7707 \ to &77F0