Pyjamarama | Routines |
Prev: EE8D | Up: Map |
Used by the routine at Game_Start.
|
|||||||
Food_CheckPickup | EE8F | LD HL,(Food_ActivePtr) | Get pointer to first active food. | ||||
EE92 | LD A,(Wally_RoomNo) | See if Wally is in the same room as the active food A. | |||||
EE95 | CP (HL) | ||||||
EE96 | JR Z,Food_CheckPickup_0 | ||||||
EE98 | LD DE,$0016 | If not, check for active food B. | |||||
EE9B | ADD HL,DE | ||||||
EE9C | CP (HL) | ||||||
EE9D | RET NZ | ||||||
Food found.
|
|||||||
Food_CheckPickup_0 | EE9E | INC HL | |||||
EE9F | LD A,(Wally_X) | Check to see if Wally is on the same X plane as the food. | |||||
EEA2 | SUB (HL) | ||||||
EEA3 | SUB $01 | ||||||
EEA5 | CP $FE | ||||||
EEA7 | RET C | ||||||
EEA8 | LD A,(Wally_Y) | Make sure he is also on the same Y position, which is fixed to $98. | |||||
EEAB | CP $98 | ||||||
EEAD | RET NZ | ||||||
EEAE | LD E,(HL) | Get the X position again and set for drawing. | |||||
EEAF | INC HL | ||||||
EEB0 | LD D,$A8 | ||||||
EEB2 | LD (BitmapX),DE | ||||||
EEB6 | LD A,(HL) | Get the bitmap index. | |||||
EEB7 | CALL Bitmap16Draw | Draw 'over' the existing bitmap which will erase it from the screen. | |||||
EEBA | LD HL,(Food_ActivePtr) | Set the next food in line as active, to replace the one just eaten. | |||||
EEBD | INC HL | ||||||
EEBE | INC HL | ||||||
EEBF | INC HL | ||||||
EEC0 | LD A,(HL) | ||||||
EEC1 | CP $FF | Check for end of group, if so wrap around to start of table again. | |||||
EEC3 | JR NZ,Food_CheckPickup_1 | ||||||
EEC5 | LD HL,Food_Table | ||||||
Food_CheckPickup_1 | EEC8 | LD (Food_ActivePtr),HL | Store address for next time. | ||||
EECB | LD B,$0A | Increase Wally's energy by 10 and update the Milk Glass. | |||||
EECD | CALL Wally_EnergyIncBy | ||||||
EED0 | LD BC,$643C | ||||||
EED3 | LD DE,$0128 | ||||||
EED6 | LD HL,$0103 | ||||||
EED9 | CALL Beep_Effect | ||||||
EEDC | RET |
Prev: EE8D | Up: Map |