Prev: 8411 Up: Map Next: 8470
843C: Increase Wally's energy by given amount.
Used by the routine at Food_CheckPickup.
Input
B Amount to increase by.
Output
Wally_EnergyIncBy 843C LD A,(MilkLevel) Add given amount to current energy value.
843F SUB B
8440 LD C,A
8441 LD (MilkLevel),A
8444 JR NC,Wally_EnergyIncBy_0 If glass is not full need to update bitmap.
8446 CALL Milk_DrawFull Glass is full up, update bitmap with full glass image
8449 XOR A
844A LD (MilkLevel),A and set level with zero.
844D RET
Wally_EnergyIncBy_0 844E PUSH AF Convert energy level into a row index address of the DF table.
844F ADD A,A
8450 LD L,A
8451 LD H,$00
8453 LD DE,DF_lookup
8456 ADD HL,DE
8457 PUSH HL
8458 POP IX
845A POP AF Convert energy level into the equivalent row on the milk full bitmap.
845B LD E,A
845C ADD A,A
845D ADD A,E
845E LD E,A
845F LD D,$00
8461 LD HL,Bmp_MilkFull
8464 ADD HL,DE
8465 PUSH BC Draw the number of rows, amount energy is increased by.
8466 INC B
8467 CALL Bmp_DrawRows
846A POP BC Increase energy to new amount.
846B LD A,C
846C LD (MilkLevel),A
846F RET
Prev: 8411 Up: Map Next: 8470