Skip to navigation

Elite on the BBC Micro and NES

Drawing the screen: CLYNS

[Elite-A, I/O processor]

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 References: This subroutine is called as follows: * tube_table calls CLYNS

This routine is run when the parasite sends a clr_line command. It 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 #&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 \ Fall through into LYN to clear the pixels from &7707 \ to &77F0