Skip to navigation


Screen buffer: DrawTrackBytes (Part 1 of 3)

Name: DrawTrackBytes (Part 1 of 3) [Show more] Type: Subroutine Category: Screen buffer Summary: Draw the pixel bytes that make up the track view (0 to 15) Deep dive: Drawing around the dashboard Drawing the track view
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawTrackView (Part 2 of 4) calls DrawTrackBytes * DrawTrackView (Part 3 of 4) calls DrawTrackBytes * DrawTrackView (Part 4 of 4) calls DrawTrackBytes

This routine draws pixel bytes 0 to 39, which draws a one-pixel high line in the track view. Note that this routine starts on a page boundary (DrawTrackBytes = &7C00). This is important as it means the code can be modified at a specific address using only the low byte of that address, as we know that high byte is the same throughout the routine. This is why the staDrawByte and ldaDrawByte lookup tables only need to store the low bytes of the addresses for instructions that we need to modify.
.DrawTrackBytes DRAW_BYTE 0 \ Draw pixel bytes 0 to 15 DRAW_BYTE 1 DRAW_BYTE 2 DRAW_BYTE 3 DRAW_BYTE 4 DRAW_BYTE 5 DRAW_BYTE 6 DRAW_BYTE 7 DRAW_BYTE 8 DRAW_BYTE 9 DRAW_BYTE 10 DRAW_BYTE 11 DRAW_BYTE 12 DRAW_BYTE 13 DRAW_BYTE 14 DRAW_BYTE 15 JMP byte1 \ Jump to part 2 to continue with pixel byte 16