![]() |
Routines |
| Prev: CA3F | Up: Map | Next: CACB |
|
Used by the routine at update_fuel_gauge.
On odd passes only. With fuel low (the high byte of fuel, $98 or more: about seven tenths used) the gauge's colour patch (2 cells by 16, at x $F0) is red on two passes in four and yellow on the others; otherwise yellow. From the entry point near its end (used by draw_panel): always yellow.
|
||||
| flash_fuel_gauge | CAA7 | LD A,(pass_counter) | Even passes: nothing. | |
| CAAA | LD B,A | |||
| CAAB | AND $01 | |||
| CAAD | RET Z | |||
| CAAE | LD A,($CC4C) | Low and bit 1 of the pass counter set: red. | ||
| CAB1 | CP $98 | |||
| CAB3 | JR C,flash_fuel_gauge_0 | |||
| CAB5 | BIT 1,B | |||
| CAB7 | JR Z,flash_fuel_gauge_0 | |||
| CAB9 | LD A,$42 | |||
| CABB | JR flash_fuel_gauge_1 | |||
|
This entry point is used by the routine at draw_panel.
|
||||
| flash_fuel_gauge_0 | CABD | LD A,$46 | Yellow. | |
| flash_fuel_gauge_1 | CABF | LD (gauge_colour),A | Set the patch's attribute and apply it. | |
| CAC2 | LD HL,$BFF0 | |||
| CAC5 | LD DE,gauge_patch | |||
| CAC8 | JP fill_attributes | |||
| Prev: CA3F | Up: Map | Next: CACB |