Prev: 52322 Up: Map Next: 52343
52323: Check Fuel Empty
Used by the routine at UpdateFuelGauge.
Used when the fuel gauge has reached the level of the fuel. If the ship is in its normal state, the gauge is at the empty row and the bottom seven bits of the frame counter are zero, the ship is put in state 1: out of fuel.
Input
B Pixel row of the fuel gauge
CheckFuelEmpty 52323 LD A,(36691) The state of the ship.
52326 AND A Return unless the ship is flying normally.
52327 RET NZ
52328 LD A,B The row of the needle.
52329 CP 190 Return unless the needle is on the empty row.
52331 RET NZ
52332 LD A,(39524) The frame counter.
52335 AND %01111111 The bottom seven bits.
52337 RET NZ Return unless they are all clear.
52338 INC A The out-of-fuel state is one.
52339 LD (36691),A Put the ship in that state.
52342 RET Return.
Prev: 52322 Up: Map Next: 52343