Prev: 47525 Up: Map Next: 47576
47564: Get Guard Speeds
Used by the routine at HandleGuardOrWizard.
Works out the speeds that make a guard follow the wall of the room, using the direction in the two lowest bits of its flags: 0 is west, 1 is north, 2 is east and 3 is south.
Input
IX Address of the guard
Output
H Speed in Y
L Speed in X
GetGuardSpeeds 47564 LD BC,47576 Point BC at the table of routines, GuardDirectionTable.
47567 LD A,(IX+13) Fetch the direction flags of the guard.
47570 AND %00000011 Keep the direction.
47572 LD L,A Use it as the number of the routine.
47573 JP RunGame_JumpToHandler Jump to the routine.
Prev: 47525 Up: Map Next: 47576