ADBE: Move Wally and animate.
Wally_Move |
ADBE |
CALL Energy_Countdown |
|
ADC1 |
LD A,(Wally_Dir) |
|
ADC4 |
CP $01 |
|
ADC6 |
JR Z,_Wally_MoveRight |
Wally_MoveLeft |
ADC8 |
LD A,(Wally_Frame) |
|
ADCB |
CALL Wally_TurnHead |
|
ADCE |
CP $00 |
|
ADD0 |
JR NC,Wally_Move_1 |
Wally_Move_0 |
ADD2 |
XOR A |
|
ADD3 |
LD (Wally_HeadTurned),A |
|
ADD6 |
XOR A |
|
ADD7 |
JR Wally_Move_2 |
Wally_Move_1 |
ADD9 |
ADD A,$02 |
|
ADDB |
CP $10 |
|
ADDD |
JR NC,Wally_Move_0 |
Wally_Move_2 |
ADDF |
CALL Wally_Erase |
|
ADE2 |
LD (Wally_Frame),A |
|
ADE5 |
LD A,L |
|
ADE6 |
SUB $02 |
|
ADE8 |
CP $07 |
|
ADEA |
JR NC,Wally_Move_3 |
|
ADEC |
LD A,$07 |
Wally_Move_3 |
ADEE |
LD L,A |
|
ADEF |
LD (Wally_X),HL |
|
ADF2 |
CALL Wally_Draw |
|
ADF5 |
RET |
_Wally_MoveRight |
ADF6 |
LD A,(Wally_Frame) |
|
ADF9 |
CALL Wally_TurnHead |
|
ADFC |
CP $10 |
|
ADFE |
JR NC,Wally_Move_5 |
Wally_Move_4 |
AE00 |
XOR A |
|
AE01 |
LD (Wally_HeadTurned),A |
|
AE04 |
LD A,$10 |
|
AE06 |
JR Wally_Move_6 |
Wally_Move_5 |
AE08 |
ADD A,$02 |
|
AE0A |
CP $20 |
|
AE0C |
JR NC,Wally_Move_4 |
Wally_Move_6 |
AE0E |
CALL Wally_Erase |
|
AE11 |
LD (Wally_Frame),A |
|
AE14 |
LD A,L |
|
AE15 |
ADD A,$02 |
|
AE17 |
CP $E9 |
|
AE19 |
JR C,Wally_Move_7 |
|
AE1B |
LD A,$E9 |
Wally_Move_7 |
AE1D |
LD L,A |
|
AE1E |
LD (Wally_X),HL |
|
AE21 |
CALL Wally_Draw |
|
AE24 |
RET |