Skip to navigation

Revs on the BBC Micro

Screen buffer: SetMarker

Name: SetMarker [Show more] Type: Subroutine Category: Screen buffer Summary: Insert a marker value into a dash data block
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * GetColour (Part 2 of 3) calls SetMarker * GetColour (Part 3 of 3) calls SetMarker * GetColour (Part 1 of 3) calls via SetMarker+3 * GetColour (Part 2 of 3) calls via SetMarker+6

This routine inserts a marker value (&AA) into the current dash data block at a specified track line, but only if the current value in the dash data block is zero, and only if the track line is in the specified range. If the routine is called via SetMarker, then it works like this: * A is set to the pitch angle (track line) of the X-th entry in the verge buffer * The A-th byte in the dash data block at (Q P) is set to the marker &AA if blockOffset <= A < Y and it is currently zero If the routine is called via SetMarker+3, then it works like this: * The A-th byte in the dash data block at (Q P) is set to the marker &AA if blockOffset <= A < Y and it is currently zero If the routine is called via SetMarker+6, then it works like this: * The Y-th byte in the dash data block at (Q P) is set to the marker &AA if blockOffset <= Y < V and it is currently zero
Arguments: Y A track line number X Index of an entry in the verge buffer (SetMarker only)
Other entry points: SetMarker+3 Use the value of A passed to the routine SetMarker+6 Use Y and V in place of A and Y
IF _ACORNSOFT OR _4TRACKS .SetMarker LDA yVergeRight,X \ Set A to the pitch angle of the X-th entry in the \ verge buffer (i.e. the track line number of the \ X-th entry) \ We join the subroutine here if we call SetMarker+3 STY V \ Set V to the track line number in Y TAY \ Set Y to the track line number in A \ We join the subroutine here if we call SetMarker+6 CPY V \ If Y >= V, jump to setm1 to return from the BCS setm1 \ subroutine with Y = V CPY blockOffset \ If Y < blockOffset, jump to setm1 to return from the BCC setm1 \ subroutine with Y = V LDA (P),Y \ If the Y-th byte in the dash data block is non-zero, BNE setm1 \ then it is not empty, so jump to setm1 to return from \ the subroutine with Y = V LDA #&AA \ Set the Y-th byte in the dash data block to &AA, to STA (P),Y \ act as a marker that gets picked up in the drawing \ routine .setm1 LDY V \ Restore Y to the track line number of the pixel byte \ to check, so it's unchanged by the call for calls to \ SetMarker and SetMarker+3 RTS \ Return from the subroutine ENDIF