Prev: 51775 Up: Map Next: 51915
51879: Colour Fuel Gauge
Used by the routine at UpdateFuelGauge.
Used on odd frames. When the fuel is low (the gauge level is at least 152) the colour of the fuel gauge alternates between red and yellow every other frame, otherwise it is yellow. ColourFuelGauge_Yellow is the entry point that always uses yellow.
ColourFuelGauge 51879 LD A,(39524) Fetch the frame counter from FrameCounter.
51882 LD B,A Keep it, so the next bit can be tested as well.
51883 AND %00000001 Is this an odd frame?
51885 RET Z Return on an even frame.
51886 LD A,(52300) Fetch the row of the top of the fuel.
51889 CP 152 Use yellow if the tank is not low.
51891 JR C,ColourFuelGauge_Yellow
51893 BIT 1,B Use yellow on the frames when bit 1 is clear.
51895 JR Z,ColourFuelGauge_Yellow
51897 LD A,66 Otherwise use red (66).
51899 JR ColourFuelGauge_Fill Fill the gauge with it.
This entry point is used by the routine at DrawHUD.
ColourFuelGauge_Yellow 51901 LD A,70 The normal colour of the gauge is yellow (70).
ColourFuelGauge_Fill 51903 LD (52141),A Store the chosen colour in the gauge attributes.
51906 LD HL,49136 The gauge hangs from the right of the bottom row.
51909 LD DE,52139 The attribute area of the gauge.
51912 JP FillAttributes Fill that area.
Prev: 51775 Up: Map Next: 51915