Prev: AD80 Up: Map Next: ADBE
AD81: Checks to see if Wally should turn his head towards the camera.
Used by the routine at Wally_Move.
Input
A Current frame to test against.
Output
Wally_TurnHead AD81 PUSH AF
AD82 CP $00 Only allow head turning on certain frames.
AD84 JR Z,Wally_TurnHead_2
AD86 CP $10
AD88 JR Z,Wally_TurnHead_2
AD8A CP $0C Clear head turn on certain frames.
AD8C JR Z,Wally_TurnHead_0
AD8E CP $1C
AD90 JR Z,Wally_TurnHead_0
AD92 LD A,(Wally_HeadCountdown) If counter is greater than zero, skip onto just counting down.
AD95 OR A
AD96 JR NZ,Wally_TurnHead_3
AD98 JR Wally_TurnHead_1
Wally_TurnHead_0 AD9A LD A,(Wally_HeadCountdown) If counter is greater than zero, skip onto just counting down.
AD9D OR A
AD9E JR NZ,Wally_TurnHead_3
ADA0 LD (Wally_HeadTurned),A Clear Wally's head turn flag(2).
ADA3 LD A,R Set a random value (0 ~ 1F) into countdown.
ADA5 AND $1F
ADA7 LD (Wally_HeadCountdown),A
Wally_TurnHead_1 ADAA POP AF
ADAB RET
Wally_TurnHead_2 ADAC LD A,(Wally_HeadCountdown) If counter is greater than zero, skip onto just counting down.
ADAF OR A
ADB0 JR NZ,Wally_TurnHead_3
ADB2 INC A Set Wall'ys head turn flag(2)
ADB3 LD (Wally_HeadTurned),A
ADB6 JR Wally_TurnHead_1
Wally_TurnHead_3 ADB8 DEC A
ADB9 LD (Wally_HeadCountdown),A
ADBC JR Wally_TurnHead_1
Prev: AD80 Up: Map Next: ADBE