.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 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 #22 ; Move the text cursor to row 22, near the bottom of STA YC ; the screen LDA #1 ; Move the text cursor to column 1 STA XC LDA firstPattern ; Set the next free pattern number in firstFreePattern STA firstFreePattern ; to the value of firstPattern, which contains the ; number of the first pattern for which we send pattern ; data to the PPU in the NMI handler, so it's also the ; pattern we can start drawing into when we next start ; drawing into tiles LDA QQ11 ; If bit 7 of the view type in QQ11 is clear then there BPL clyn2 ; is a dashboard, so jump to clyn2 to return from the ; subroutine LDA #HI(nameBuffer0+23*32) ; Set SC(1 0) to the address of the tile in STA SC+1 ; column 0 on tile row 23 in nametable buffer 0 LDA #LO(nameBuffer0+23*32) STA SC LDA #HI(nameBuffer1+23*32) ; Set SC(1 0) to the address of the tile in STA SC2+1 ; column 0 on tile row 23 in nametable buffer 1 LDA #LO(nameBuffer1+23*32) STA SC2 LDX #2 ; We want to clear two text rows, row 23 and row 24, so ; set a counter in X to count 2 rows .CLYL JSR SetupPPUForIconBar ; If the PPU has started drawing the icon bar, configure ; the PPU to use nametable 0 and pattern table 0 LDY #2 ; We are going to clear tiles from column 2 to 30 on ; each row, so set a tile index in Y to start from ; column 2 LDA #0 ; Set A = 0 to use as the pattern number for the blank ; background tile .EE2 STA (SC),Y ; Set the Y-th tile on the row in nametable buffer 0 to ; the blank tile STA (SC2),Y ; Set the Y-th tile on the row in nametable buffer 1 to ; the blank tile INY ; Increment the tile counter to move on to the next tile CPY #31 ; Loop back to blank the next tile until we have done BNE EE2 ; all the tiles up to column 30 LDA SC ; Add 32 to SC(1 0) to point to the next row, starting ADC #31 ; with the low bytes (the ADC #31 adds 32 because the C STA SC ; flag is set from the comparison above, which resulted ; in equality) STA SC2 ; Add 32 to the low byte of SC2(1 0) as well BCC clyn1 ; If the addition didn't overflow, jump to clyn1 to skip ; the high bytes INC SC+1 ; Increment the high bytes of SC(1 0) and SC2(1 0) INC SC2+1 ; to point to the next page in memory .clyn1 DEX ; Decrement the row counter in X BNE CLYL ; Loop back to blank another row, until we have done the ; number of rows in X .clyn2 RTS ; Return from the subroutineName: CLYNS [Show more] Type: Subroutine Category: Drawing the screen Summary: Clear the bottom two text rows of the visible screenContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ChangeCmdrName calls CLYNS * dockEd calls CLYNS * FlightLoop4To16 calls CLYNS * HME2 calls CLYNS * JMTB calls CLYNS * SetSelectedSystem calls CLYNS * TT102 calls CLYNS * TT147 calls CLYNS * YESNO calls CLYNS * PrintFlightMessage calls via CLYNS+8
This routine clears some space at the bottom of the screen and moves the text cursor to column 1, row 22.
Other entry points: CLYNS+8 Don't zero DLY and de
[X]
Label CLYL is local to this routine
[X]
Label EE2 is local to this routine
[X]
Subroutine SetupPPUForIconBar (category: PPU)
If the PPU has started drawing the icon bar, configure the PPU to use nametable 0 and pattern table 0, while preserving A
[X]
Label clyn1 is local to this routine
[X]
Label clyn2 is local to this routine
[X]
Variable firstFreePattern in workspace ZP
Contains the number of the first free pattern in the pattern buffer that we can draw into next (or 0 if there are no free patterns)
[X]
Variable firstPattern in workspace ZP
The number of the first pattern for which we send data to the PPU in the NMI handler (potentially for both bitplanes, if both are configured to be sent)
[X]
Variable nameBuffer0 in workspace Cartridge WRAM
The buffer for nametable 0 that gets sent to the PPU during VBlank
[X]
Variable nameBuffer1 in workspace Cartridge WRAM
The buffer for nametable 1 that gets sent to the PPU during VBlank