.SetDrawPlaneFlags PHA ; Store A on the stack, so we can retrieve them below ; when setting the new drawing bitplane flags JSR DrawBoxEdges ; Draw the left and right edges of the box along the ; sides of the screen, drawing into the nametable buffer ; for the drawing bitplane LDX drawingBitplane ; Set X to the drawing bitplane LDA firstFreePattern ; Tell the NMI handler to send pattern entries up to the STA lastPattern,X ; first free pattern, for the drawing bitplane in X PLA ; Retrieve A from the stack and set it as the value of STA bitplaneFlags,X ; the drawing bitplane flags RTS ; Return from the subroutineName: SetDrawPlaneFlags [Show more] Type: Subroutine Category: Drawing the screen Summary: Set the drawing bitplane flags to the specified value, draw the box edges and set the next free tile number Deep dive: Drawing vector graphics using NES tilesContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DEATH calls SetDrawPlaneFlags * DrawSpaceViewInNMI calls SetDrawPlaneFlags * SendBitplaneToPPU calls SetDrawPlaneFlags * SetupViewInNMI calls SetDrawPlaneFlags
[X]
Subroutine DrawBoxEdges (category: Drawing the screen)
Draw the left and right edges of the box along the sides of the screen, drawing into the nametable buffer for the drawing bitplane
[X]
Variable bitplaneFlags in workspace WP
Flags for bitplane 0 that control the sending of data for this bitplane to the PPU during VBlank in the NMI handler
[X]
Variable drawingBitplane in workspace ZP
Flipped manually by calling FlipDrawingPlane, controls whether we are showing nametable/palette buffer 0 or 1
[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 lastPattern in workspace ZP
The number of the last pattern entry to send from pattern buffer 0 to bitplane 0 of the PPU pattern table in the NMI handler