.ChangeToView JSR TT66 ; Clear the screen and set the view type in QQ11 to the ; value of A JSR CopyNameBuffer0To1 ; Copy the contents of nametable buffer 0 to nametable ; buffer JSR UpdateScreen ; Update the screen by sending data to the PPU, either ; immediately or during VBlank, depending on whether ; the screen is visible LDA #$00 ; Set the view type in QQ11 to $00 (Space view with no STA QQ11 ; font loaded) STA QQ11a ; Set the old view type in QQ11a to $00 (Space view with ; no fonts loaded) STA showIconBarPointer ; Set showIconBarPointer to 0 to indicate that we should ; hide the icon bar pointer LDA firstFreePattern ; Tell the NMI handler to send pattern entries from the STA firstPattern ; first free pattern onwards, so we don't waste time ; resending the static patterns we have already sent LDA #80 ; Tell the NMI handler to only clear nametable entries STA maxNameTileToClear ; up to tile 80 * 8 = 640 (i.e. up to the end of tile ; row 19) LDX #8 ; Tell the NMI handler to send nametable entries from STX firstNameTile ; tile 8 * 8 = 64 onwards (i.e. from the start of tile ; row 2) RTS ; Return from the subroutineName: ChangeToView [Show more] Type: Subroutine Category: Drawing the screen Summary: Clear the screen and set a new view typeContext: See this subroutine in context in the source code References: This subroutine is called as follows: * BRIEF calls ChangeToView * ChangeToView_b0 calls ChangeToView * LAUN calls ChangeToView * TITLE calls ChangeToView
Arguments: A The type of the new view
[X]
Subroutine CopyNameBuffer0To1 (category: Drawing the screen)
Copy the contents of nametable buffer 0 to nametable buffer 1
[X]
Subroutine TT66 (category: Drawing the screen)
Clear the screen and set the new view type
[X]
Subroutine UpdateScreen (category: PPU)
Update the screen by sending data to the PPU, either immediately or during VBlank, depending on whether the screen is visible
[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 firstNameTile in workspace ZP
The number of the first tile for which we send nametable data to the PPU in the NMI handler (potentially for both bitplanes, if both are configured to be sent)
[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 maxNameTileToClear in workspace ZP
The tile number at which the NMI handler should stop clearing tiles in the nametable buffers during its clearing cycle
[X]
Variable showIconBarPointer in workspace WP
Controls whether to show the icon bar pointer