This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Name: MSBAR Type: Subroutine Category: Dashboard
.MSBAR
Returns: X X is preserved Y Y is set to 0
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Electron versions.
LDA #%00001111 \ Set bits 1 and 2 of the Access Control Register at STA VIA+&34 \ SHEILA &34 to switch screen memory into &3000-&7FFF TXA \ Store the value of X on the stack so we can preserve PHA \ it across the call to this subroutine
This variation is blank in the Cassette, Disc (flight), Disc (docked), Master and Electron versions.
LDY #2 \ Fetch byte #2 from the parameter block (the number of LDA (OSSC),Y \ the missile indicator) into A
\ So the low byte of SC(1 0) contains the row address \ for the rightmost missile indicator, made up as \ follows: \
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Master versions.
\ * &80 + 32 as described above \
\ character block of the rightmost missile \ \ * 1 (so we start drawing on the second row of the \ character block) \ \ * Move left one character (8 bytes) for each count \ of X, so when X = 0 we are drawing the rightmost \ missile, for X = 1 we hop to the left by one \ character, and so on
The monochrome dashboard can't use colour to indicate the status of the missiles, so instead the Electron version uses four different bitmaps - black (no missile), white box (disarmed), black box in white square (armed), and black "T" in white square (armed and locked).
See below for more variations related to this code.
This variation is blank in the 6502 Second Processor and Master versions.
Tap on a block to expand it, and tap it again to revert.
This variation is blank in the Cassette, Disc (flight), Disc (docked) and Electron versions.
Tap on a block to expand it, and tap it again to revert.
This variation is blank in the Cassette, Disc (flight), Disc (docked) and Electron versions.
LDY #5 \ We now want to draw this line five times to do the \ left two pixels of the indicator, so set a counter in \ Y .MBL1 STA (SC),Y \ Draw the three-pixel row, and as we do not use EOR \ logic, this will overwrite anything that is already \ there (so drawing a black missile will delete what's \ there) DEY \ Decrement the counter for the next row BNE MBL1 \ Loop back to MBL1 if have more rows to draw PHA \ Store the value of A on the stack so we can retrieve \ it after the following addition LDA SC \ Set SC = SC + 8 CLC \ ADC #8 \ so SC(1 0) now points to the next character block on STA SC \ the row (for the right half of the indicator) PLA \ Retrieve A from the stack AND #%10101010 \ Mask the character row to plot just the first pixel \ in the next character block, as we already did a \ two-pixel wide band in the previous character block, \ so we need to plot just one more pixel, width-wise
LDY #5 \ We now want to draw this line five times, so set a \ counter in Y
Code variation 14 of 19
See variation 10 above for details.
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Master versions.
LDA MDIALS,X \ Fetch the X-th bitmap from the MDIALS table
Code variation 16 of 19
See variation 10 above for details.
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Master versions.
DEX \ Decrement the bitmap counter for the next row
DEY \ Decrement the counter for the next row
This variation is blank in the Cassette, Disc (flight), Disc (docked) and 6502 Second Processor versions.
Tap on a block to expand it, and tap it again to revert.