Skip to navigation

Revs on the BBC Micro

Dashboard: CopyTyreDashEdges

Name: CopyTyreDashEdges [Show more] Type: Subroutine Category: Dashboard Summary: Fetch the pixel bytes from the right edge of the left tyre and the right edge of the dashboard, and fill to the right of the edge
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MainDrivingLoop (Part 2 of 5) calls CopyTyreDashEdges

This routine populates the tyreRightEdge and dashRightEdge tables with the pixel bytes along the right edge of the left tyre and the right edge of the dashboard respectively. It also fills the block to the right of the edge with the appropiate content, so the feathered edges don't fill to the right.
.CopyTyreDashEdges LDA #HI(tyreRightEdge) \ Set (S R) = tyreRightEdge STA S \ LDA #LO(tyreRightEdge) \ so the call to GetTyreDashEdges copies the pixel data STA R \ from the tyre edge into the tyreRightEdge table LDY #27 \ Start at byte 27 in the dash data, so we work down the \ screen from track line 27 LDX #3 \ Loop through dash data blocks 3 to 5 LDA #6 JSR GetTyreDashEdges \ Fetch the pixel bytes from along the right edge of the \ left tyre and fill the block to the right of the edge \ with the appropriate content LDA #HI(dashRightEdge) \ Set (S R) = dashRightEdge STA S \ LDA #LO(dashRightEdge) \ so the call to GetTyreDashEdges copies the pixel data STA R \ from the dashboard edge into the dashRightEdge table LDY #43 \ Start at byte 43 in the dash data, so we work down the \ screen from track line 43 LDX #26 \ Loop through dash data blocks 26 to 33 LDA #34 JSR GetTyreDashEdges \ Fetch the pixel bytes from along the right edge of the \ dashboard and fill the block to the right of the edge \ with the appropriate content RTS \ Return from the subroutine