Skip to navigation

Revs on the BBC Micro

Screen buffer: DrawTrackView (Part 1 of 4)

Name: DrawTrackView (Part 1 of 4) [Show more] Type: Subroutine Category: Screen buffer Summary: Draw the top part of the track view using the data in the dash data blocks Deep dive: Drawing around the dashboard Drawing the track view The track verges
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MainDrivingLoop (Part 1 of 5) calls DrawTrackView * MainDrivingLoop (Part 2 of 5) calls DrawTrackView
.DrawTrackView LDA #0 \ Set (Q P) = &6700 and (S R) = &6800, ready to pass to STA P \ the DrawTrackLine routine (so the track view gets STA R \ drawn at the correct place on screen, from &6701 LDX #&67 \ onwards, as the first line is drawn at (Q P) + 1) STX Q INX STX S LDX #79 \ Set X = 79, to point to the first byte to draw from \ each dash data block (i.e. the byte at the end of the \ data block, at offset 79) JSR DrawTrackLine \ Draw one-pixel high lines that correspond to dash data \ offsets 79 to 44, returning from the subroutine after \ drawing the line specified by offset X = 44 (so this \ draws all the lines from the top of the track view, \ down to the line just above the top of the dashboard) JMP view1 \ Jump to part 2 to draw the rest of the track view from \ offsets 43 to 3, modifying the code so it draws the \ rest of the lines around the shape of the dashboard