This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
.TTX66Name: TTX66 Type: Subroutine Category: Drawing the screen Summary: Clear the top part of the screen and draw a border box
Clear the top part of the screen (the space view) and draw a border box along the top and sides.
Other entry points: BOX Just draw the border box along the top and sides
LDX #%00001111 \ Set bits 1 and 2 of the Access Control Register at STX VIA+&34 \ SHEILA &34 to switch screen memory into &3000-&7FFF
LDX #&40 \ Set X to point to page &40, which is the start of the \ screen memory at &4000 .BOL1 JSR ZES1 \ Call ZES1 to zero-fill the page in X, which will clear \ half a character row INX \ Increment X to point to the next page in screen \ memory CPX #&70 \ Loop back to keep clearing character rows until we BNE BOL1 \ have cleared up to &7000, which is where the dashboard \ starts .BOX
LDX #%00001111 \ Set bits 1 and 2 of the Access Control Register at STX VIA+&34 \ SHEILA &34 to switch screen memory into &3000-&7FFF LDA COL \ Store the current colour on the stack, so we can PHA \ restore it once we have drawn the border
LDA #%00001111 \ Set COL = %00001111 to act as a four-pixel yellow STA COL \ character byte (i.e. set the line colour to yellow) LDY #1 \ Move the text cursor to row 1 STY YC
LDA #2 \ Set X1 = X2 = 2 STA X1 STA X2
.BOS2 JSR BOS1 \ Call BOS1 below and then fall through into it, which \ ends up running BOS1 twice. This is all part of the \ loop-the-loop border-drawing mind-bender explained \ above .BOS1
LDA #2*Y-1 \ Set Y2 = 2 * #Y - 1. The constant #Y is 96, the STA Y2 \ y-coordinate of the mid-point of the space view, so \ this sets Y2 to 191, the y-coordinate of the bottom \ pixel row of the space view DEC X1 \ Decrement X1 and X2 DEC X2