Skip to navigation

Drawing the screen: WSCAN

[BBC Master version]

Name: WSCAN [Show more] Type: Subroutine Category: Drawing the screen Summary: Implement the #wscn command (wait for the vertical sync)
Context: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * DELAY calls WSCAN * DK4 calls WSCAN * TT16 calls WSCAN

Wait for vertical sync to occur on the video system - in other words, wait for the screen to start its refresh cycle, which it does 50 times a second (50Hz).
.WSCAN STZ DL \ Set DL to 0 { .DELL1 \ This label is a duplicate of a label in the DELT \ routine (which is why we need to surround it with \ braces, as BeebAsm doesn't allow us to redefine \ labels, unlike BBC BASIC) LDA DL \ Loop round these two instructions until DL is no BEQ DELL1 \ longer 0 (DL gets set to 30 in the LINSCN routine, \ which is run when vertical sync has occurred on the \ video system, so DL will change to a non-zero value \ at the start of each screen refresh) } RTS \ Return from the subroutine