Skip to navigation


Drawing the track: StopDrawingEdge

Name: StopDrawingEdge [Show more] Type: Subroutine Category: Drawing the track Summary: Stop drawing the current segment's verge edge
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawVergeByteLeft calls StopDrawingEdge * DrawVergeByteRight calls StopDrawingEdge

This routine stops drawing the current segment's edge when called from DrawVergeByteLeft or DrawVergeByteRight.
.StopDrawingEdge TSX \ These instructions remove two bytes from the top of INX \ the stack so the RTS below returns an extra level up INX \ the call chain TXS \ \ We jump to this routine from the DrawVergeByteLeft and \ DrawVergeByteRight routines. These are only called \ from the DrawShallowToLeft, DrawShallowToRight, \ DrawSteepToLeft or DrawSteepToRight routines, which in \ turn are only called from DrawSegmentEdge, so this \ returns us to DrawSegmentEdge to stop drawing the \ current segment's verge edge and move on to the next \ segment LDA updateBackground \ If updateBackground is non-zero, then we just drew a BNE UpdateBackground \ verge on the start of the left edge of the screen, so \ call UpdateBackground to update the background colour \ for this track line, returning from the subroutine \ using a tail call RTS \ Return from the subroutine