Prev: CC4B Up: Map Next: CC62
CC4D: Change the fuel, keeping the level between full and empty
Used by the routines at contact_refuel, contact_drain_fuel and read_controls.
Input
DE The amount to add to the fuel word (positive burns, negative fills)
add_fuel CC4D LD HL,(fuel) Add it.
CC50 ADD HL,DE
CC51 LD A,H No emptier than $BE.
CC52 CP $BE
CC54 JR C,add_fuel_0
CC56 LD H,$BE
add_fuel_0 CC58 CP $42 No fuller than $42.
CC5A JR NC,add_fuel_1
CC5C LD H,$42
add_fuel_1 CC5E LD (fuel),HL Store it.
CC61 RET
Prev: CC4B Up: Map Next: CC62