Skip to navigation

Revs on the BBC Micro

Dashboard: EraseRevCounter

Name: EraseRevCounter [Show more] Type: Subroutine Category: Dashboard Summary: Erase a line by replacing each pixel in the line with its original contents
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * UpdateDashboard calls EraseRevCounter
.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 subroutine