Skip to navigation

Revs on the BBC Micro

Drawing the track: DrawSegmentEdge (Part 7 of 7)

Name: DrawSegmentEdge (Part 7 of 7) [Show more] Type: Subroutine Category: Drawing the track Summary: Save the angles for the next call to DrawSegmentEdge and return from the subroutine Deep dive: Drawing the track verges
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file

This part gets things ready for the next call to DrawSegmentEdge, when we draw the next segment's verge edge, and returns from the subroutine.
.dver28 LDA vergeOnScreenEdge \ If bit 7 of vergeOnScreenEdge is set then the edge we BMI dver29 \ are drawing is partially off-screen, so jump to dver29 \ to skip the following \ If we get here then the edge we are drawing is wholly \ on-screen, so we can store the edge's angles in M and \ N to be picked up in the next call to DrawSegmentEdge LDA W \ Set M = W, so we pass on 128 + yaw angle * 4 STA M LDA RR \ Set N = RR, so we pass on the pitch angle STA N .dver29 LDX thisYawIndex \ Set X to the original yaw angle index that we stored \ above, so X is preserved through calls to the routine LDY thisPitchIndex \ Set Y to the original pitch angle index that we stored \ above, so Y is preserved through calls to the routine RTS \ Return from the subroutine EQUB &A5, &53 \ These bytes appear to be unused EQUB &F0, &EB EQUB &20, &12 EQUB &2F, &4C EQUB &FC, &2C