Skip to navigation

Aviator on the BBC Micro

Dashboard: UpdateFuelGauge

Name: UpdateFuelGauge [Show more] Type: Subroutine Category: Dashboard Summary: Update the fuel gauge every 16 iterations of the main loop Deep dive: Scheduling tasks in the main loop
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MainLoop (Part 11 of 15) calls UpdateFuelGauge * ResetVariables calls UpdateFuelGauge
.UpdateFuelGauge LDA mainLoopCounter \ If the mainLoopCounter is a multiple of 16, jump to AND #15 \ upfu1 to update the fuel gauge BEQ upfu1 RTS \ Return from the subroutine .upfu1 LDX #128 \ Set X = 128, so we erase a pixel from the top of the \ fuel gauge in DrawFuelPixel below, if there is one LDA fuelLevel \ Set A = fuelLevel \ Fall through into DrawFuelPixel to erase a pixel from \ the fuel gauge at the top of the gauge if there is \ one, which will set the amount shown on the fuel gauge \ to fuelLevel