Skip to navigation

Aviator on the BBC Micro

Drawing lines: SwapLinePoints

Name: SwapLinePoints [Show more] Type: Subroutine Category: Drawing lines Summary: Copy an end point into a start point
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ClipBestEndOfLine calls SwapLinePoints * DrawClippedLine (Part 4 of 6) calls SwapLinePoints

Arguments: (QQ W) The x-coordinate of the line's end point (H G) The y-coordinate of the line's end point UU The clipping requirements for the end point
Returns: (RR R) Gets set to the x-coordinate above (SS S) Gets set to the y-coordinate above TT Gets set to the clipping requirements above
.SwapLinePoints LDA W \ Set (RR R) = (QQ W) STA R LDA QQ STA RR LDA G \ Set (SS S) = (H G) STA S LDA H STA SS LDA UU \ Set TT = UU STA TT RTS \ Return from the subroutine