Prev: 40627 Up: Map Next: 40726
40710: Wake Animal
Used by the routine at HandlerSleepingHippoWarthog.
Wakes up a hippo or a warthog by resetting bit 2 of the sprite ID. Bit 3 of the sprite ID is set from bit 3 of the random seed, which makes it a warthog (set) or a hippo (reset).
Input
IX Actor record
WakeAnimal 40710 LD A,(38549) Fetch the random seed from RandomNumber.
40713 AND %00001000 Keep only bit 3.
40715 LD C,A Stash bit 3 of the random seed in C.
40716 LD A,(IX+0) Fetch the sprite ID of the animal.
40719 AND %11110011 Keep only bits 0-1 and 4-7.
40721 OR C Merge in bit 3 from the random seed.
40722 LD (IX+0),A Store the new sprite ID of the animal.
40725 RET Return.
Prev: 40627 Up: Map Next: 40726