LDA #&70 \ Set SC(1 0) = &7020, which is the screen address for STA SC+1 \ the character block containing the left end of the LDA #&20 \ top indicator in the left part of the dashboard, the STA SC \ one showing the forward shield LDA FSH \ Draw the forward shield indicator using a range of JSR DILX \ 0-255, and increment SC to point to the next indicator \ (the aft shield) LDA ASH \ Draw the aft shield indicator using a range of 0-255, JSR DILX \ and increment SC to point to the next indicator (the \ fuel level) LDA #YELLOW2 \ Set K (the colour we should show for high values) to STA K \ yellow STA K+1 \ Set K+1 (the colour we should show for low values) to \ yellow, so the fuel indicator always shows in this \ colour LDA QQ14 \ Draw the fuel level indicator using a range of 0-63, JSR DILX+2 \ and increment SC to point to the next indicator (the \ cabin temperature) JSR PZW2 \ Call PZW2 to set A to the colour for dangerous values \ and X to the colour for safe values, suitable for \ non-striped indicators STX K+1 \ Set K+1 (the colour we should show for low values) to \ X (the colour to use for safe values) STA K \ Set K (the colour we should show for high values) to \ A (the colour to use for dangerous values) \ The above sets the following indicators to show red \ for high values and yellow/white for low values, which \ we use for the cabin and laser temperature bars LDX #11 \ Set T1 to 11, the threshold at which we change the STX T1 \ cabin and laser temperature indicators' colours LDA CABTMP \ Draw the cabin temperature indicator using a range of JSR DILX \ 0-255, and increment SC to point to the next indicator \ (the laser temperature) LDA GNTMP \ Draw the laser temperature indicator using a range of JSR DILX \ 0-255, and increment SC to point to the next indicator \ (the altitude) LDA #240 \ Set T1 to 240, the threshold at which we change the STA T1 \ altitude indicator's colour. As the altitude has a \ range of 0-255, pixel 16 will not be filled in, and \ 240 would change the colour when moving between pixels \ 15 and 16, so this effectively switches off the colour \ change for the altitude indicator LDA #YELLOW2 \ Set K (the colour we should show for high values) to STA K \ yellow STA K+1 \ Set K+1 (the colour we should show for low values) to \ yellow, so the altitude indicator always shows in this \ colour LDA ALTIT \ Draw the altitude indicator using a range of 0-255, JMP DILX \ returning from the subroutine using a tail callName: DIALS (Part 4 of 4) [Show more] Type: Subroutine Category: Dashboard Summary: Update the dashboard: shields, fuel, laser & cabin temp, altitude Deep dive: The dashboard indicatorsContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: No direct references to this subroutine in this source file
[X]
Variable ALTIT in workspace I/O variables
Our altitude above the surface of the planet or sun
[X]
Variable ASH in workspace I/O variables
Aft shield status
[X]
Variable CABTMP in workspace I/O variables
Cabin temperature
[X]
Subroutine DILX (category: Dashboard)
Update a bar-based indicator on the dashboard
[X]
Variable FSH in workspace I/O variables
Forward shield status
[X]
Variable GNTMP in workspace I/O variables
Laser temperature (or "gun temperature")
[X]
Variable K in workspace I/O variables
Temporary storage, used in a number of places
[X]
Subroutine PZW2 (category: Dashboard)
Fetch the current dashboard colours for non-striped indicators, to support flashing
[X]
Variable QQ14 in workspace I/O variables
Our current fuel level (0-70)
[X]
Configuration variable YELLOW2 = %00001111
Two mode 2 pixels of colour 3 (yellow)