Skip to navigation

Elite on the BBC Micro

Dashboard: DIALS (Part 4 of 4) [Electron version]

Name: 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 indicators
Context: 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
LDA #&76 \ Set SC(1 0) = &7630, which is the screen address for STA SC+1 \ the character block containing the left end of the LDA #&30 \ 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 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) SEC \ Call NEXTR with the C flag set to move the screen JSR NEXTR \ address in SC(1 0) down by one character row 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, which would set the threshold at which STA T1 \ we change the altitude indicator's colour in the other \ versions, but it has no effect here, as the Electron \ version doesn't support indicator colour changes STA K+1 \ This sets K+1 to 240, which would set the colour to \ show for low values in the other versions, but it has \ no effect here, as the Electron version doesn't \ support indicator colour changes LDA ALTIT \ Draw the altitude indicator using a range of 0-255 JSR DILX JMP COMPAS \ We have now drawn all the indicators, so jump to \ COMPAS to draw the compass, returning from the \ subroutine using a tail call