.SetDrawingBitplane STX drawingBitplane ; Set the drawing bitplane to X LDA lastPattern,X ; Set the next free pattern number in firstFreePattern STA firstFreePattern ; to the number of the last pattern that was sent to the ; PPU for the new bitplane LDA nameBufferHiAddr,X ; Set the high byte of the nametable buffer for the new STA nameBufferHi ; bitplane in nameBufferHiAddr LDA #0 ; Set the low byte of pattBufferAddr(1 0) to zero (we STA pattBufferAddr ; will set the high byte in SetPatternBuffer below STA drawingPlaneDebug ; Set drawingPlaneDebug = 0 (though this value is never ; read, so this has no effect) ; Fall through into SetPatternBuffer to set the high ; bytes of the patten buffer address variablesName: SetDrawingBitplane [Show more] Type: Subroutine Category: Drawing the screen Summary: Set the drawing bitplane to a specified valueContext: See this subroutine in context in the source code References: This subroutine is called as follows: * FlipDrawingPlane calls SetDrawingBitplane * SendViewToPPU calls SetDrawingBitplane * SetDrawingPlaneTo0 calls SetDrawingBitplane * SetupViewInNMI calls SetDrawingBitplane * TT66 calls SetDrawingBitplane
Arguments: X The new value of the drawing bitplane
[X]
Variable drawingBitplane in workspace ZP
Flipped manually by calling FlipDrawingPlane, controls whether we are showing nametable/palette buffer 0 or 1
[X]
Variable drawingPlaneDebug in workspace ZP
This variable is set to 0 whenever the drawing bitplane changes, but it is never read, so maybe this is part of some debug code that was left behind?
[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
[X]
Variable nameBufferHi in workspace ZP
High byte of the address of the current nametable buffer ($70 or $74)
[X]
Variable nameBufferHiAddr (category: Drawing the screen)
The high bytes of the addresses of the two nametable buffers
[X]
Variable pattBufferAddr in workspace ZP
Address of the current pattern buffer