![]() |
Routines |
| Prev: 9EB3 | Up: Map | Next: 9F16 |
|
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).
|
||||||||
| WakeAnimal | 9F06 | LD A,($9695) | Fetch the random seed from RandomNumber. | |||||
| 9F09 | AND %00001000 | Keep only bit 3. | ||||||
| 9F0B | LD C,A | Stash bit 3 of the random seed in C. | ||||||
| 9F0C | LD A,(IX+$00) | Fetch the sprite ID of the animal. | ||||||
| 9F0F | AND %11110011 | Keep only bits 0-1 and 4-7. | ||||||
| 9F11 | OR C | Merge in bit 3 from the random seed. | ||||||
| 9F12 | LD (IX+$00),A | Store the new sprite ID of the animal. | ||||||
| 9F15 | RET | Return. | ||||||
| Prev: 9EB3 | Up: Map | Next: 9F16 |