Skip to navigation

Elite on the BBC Micro and NES

Drawing the screen: SetDrawingBitplane

[NES version, Bank 7]

Name: SetDrawingBitplane [Show more] Type: Subroutine Category: Drawing the screen Summary: Set the drawing bitplane to a specified value
Context: 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
.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 variables