.EraseRevCounter LDX lineBufferSize \ Set X to the size of the line buffer BEQ erev2 \ If the line buffer is empty, jump to erev2 to return \ from the subroutine, as there is no line to erase DEX \ Decrement X so that it can work as a buffer counter \ working through buffer entries X down to 0 .erev1 LDA lineBufferAddrLo,X \ Set (Q P) to the screen address of the X-th pixel in STA P \ the line buffer LDA lineBufferAddrHi,X STA Q LDA lineBufferPixel,X \ Set A to the original screen contents of the X-th in \ the line buffer LDY #0 \ Restore the pixel to its original screen content, i.e. STA (P),Y \ the pixel that was there before we drew a line over \ the top of it DEX \ Decrement the buffer counter BPL erev1 \ Loop back until we have restored all the pixels in the \ line buffer STY lineBufferSize \ Set lineBufferSize = 0, to reset the line buffer .erev2 RTS \ Return from the subroutineName: EraseRevCounter [Show more] Type: Subroutine Category: Dashboard Summary: Erase a line by replacing each pixel in the line with its original contentsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * UpdateDashboard calls EraseRevCounter
[X]
Label erev1 is local to this routine
[X]
Label erev2 is local to this routine
[X]
Variable lineBufferAddrHi in workspace Main variable workspace
The low byte of the screen address of each pixel in the line buffer
[X]
Variable lineBufferAddrLo in workspace Main variable workspace
The low byte of the screen address of each pixel in the line buffer
[X]
Variable lineBufferPixel in workspace Main variable workspace
The original screen contents of each pixel in the line buffer
[X]
Variable lineBufferSize in workspace Zero page
The size of the line buffer