Prev: 6639 Up: Map Next: 6669
6653: Handle Monster Waiting
State 01 of the monster; it stays where it is for a short time, changing between its two frames every 08 frames.
Input
IX Actor
HandleMonster_Waiting 6653 DEC (IX+$07) Decrease the timer in byte 07 of the actor by one.
6656 JR Z,HandleMonster_NextState Jump to HandleMonster_NextState if the timer is zero.
6658 LD A,($5F1D) Fetch the frame counter.
665B AND %00000111 Keep only bits 0-2.
665D JR NZ,HandleMonster_Draw Jump to HandleMonster_Draw unless the frame counter is a multiple of 08.
665F LD A,(IX+$00) Fetch the actor ID.
6662 XOR %00000001 Flip bit 0, which chooses the other frame of the monster.
6664 LD (IX+$00),A Update the actor ID with the other frame of the monster.
6667 JR HandleMonster_Draw Jump to HandleMonster_Draw.
Prev: 6639 Up: Map Next: 6669