![]() |
Routines |
| Prev: B72C | Up: Map | Next: B753 |
|
Used by the routines at Handle_Carrying_Eagle, Limit_Eagle_Sideways_Movement and Limit_Eagle_Vertical_Movement.
Chooses the point that an eagle flies towards while it carries Sabreman (see Handle_Carrying_Eagle). The x position (byte 0C) is a random number from 40 to BF from the frame counter. The y position (byte 0E) is a random number from 4C to 6B from the refresh register.
|
||||||||
| Choose_Eagle_Target | B73F | LD A,($5C78) | Fetch the low byte of the frame counter. | |||||
| B742 | AND %01111111 | Keep only the low seven bits. | ||||||
| B744 | ADD A,$40 | Add 40. | ||||||
| B746 | LD (IX+$0C),A | Store the target x position. | ||||||
| B749 | LD A,R | Fetch a random number from the refresh register. | ||||||
| B74B | AND %00011111 | Keep only the low five bits. | ||||||
| B74D | ADD A,$4C | Add 4C. | ||||||
| B74F | LD (IX+$0E),A | Store the target y position. | ||||||
| B752 | RET | Return. | ||||||
| Prev: B72C | Up: Map | Next: B753 |