Prev: 46892 Up: Map Next: 46931
46911: Choose Eagle Target
Chooses the point that an eagle flies towards while it carries Sabreman (see Handle_Carrying_Eagle). The x position (byte 12) is a random number from 64 to 191 from the frame counter. The y position (byte 14) is a random number from 76 to 107 from the refresh register.
Input
IX Object record of the eagle
Choose_Eagle_Target 46911 LD A,(23672) Fetch the low byte of the frame counter.
46914 AND %01111111 Keep only the low seven bits.
46916 ADD A,64 Add 64.
46918 LD (IX+12),A Store the target x position.
46921 LD A,R Fetch a random number from the refresh register.
46923 AND %00011111 Keep only the low five bits.
46925 ADD A,76 Add 76.
46927 LD (IX+14),A Store the target y position.
46930 RET Return.
Prev: 46892 Up: Map Next: 46931