Prev: FC6E Up: Map Next: FC97
FC70: Handles countdown which indicates the loss of energy.
Used by the routines at Wally_Jump and Wally_Move.
Input
Output
Counts down from $012c. When zero is reached each time, Wally loses one bar of energy.
Energy_Countdown FC70 PUSH AF
FC71 LD A,(IgnoreEnergy) Skip countdown?
FC74 OR A
FC75 JR NZ,Energy_Countdown_Skip
FC77 PUSH HL
FC78 PUSH BC
FC79 PUSH DE
FC7A LD HL,(EnergyCounter) Decrease the countdown.
FC7D DEC HL
FC7E LD (EnergyCounter),HL
FC81 LD A,L See if reached zero.
FC82 OR H
FC83 JR Z,Energy_Countdown_Reset
Energy_Countdown_End FC85 POP DE
FC86 POP BC
FC87 POP HL
Energy_Countdown_Skip FC88 POP AF
FC89 RET
Energy_Countdown_Reset FC8A LD HL,$012C Reset counter.
FC8D LD (EnergyCounter),HL
FC90 LD B,$01 Lose one bar of energy.
FC92 CALL Milk_DecreaseByAmount
FC95 JR Energy_Countdown_End
Prev: FC6E Up: Map Next: FC97