Prev: B001 Up: Map Next: B0A9
B01D: Draw hero legs (walk cycle animator)
Used by the routine at main.
draw_hero_legs B01D LD A,($C34E) Load var_leg_frame (current leg frame index) into A
B020 CP $00 If frame == 0 → draw_hero_legs_0 (draw frame 1)
B022 JP Z,draw_hero_legs_0
B025 CP $01 If frame == 1 → draw_hero_legs_1 (draw frame 2)
B027 JP Z,draw_hero_legs_1
B02A CP $02 If frame == 2 → draw_hero_legs_2 (draw frame 3)
B02C JP Z,draw_hero_legs_2
B02F CP $03 If frame == 3 → draw_hero_legs_3 (draw frame 4)
B031 JP Z,draw_hero_legs_3
B034 CP $04 If frame == 4 → draw_hero_legs_0 (wrap back to frame 1)
B036 JP Z,draw_hero_legs_0
draw_hero_legs_0 B039 LD A,$01 Set var_leg_frame = 1
B03B LD ($C34E),A
B03E LD HL,$B0A9 Draw torso frame frame_hero_torso
B041 CALL draw_frame
B044 LD HL,$5C36 Set CHARS to $C328 (leg frame 2 tileset)
B047 LD A,$28
B049 LD (HL),A
B04A INC HL
B04B LD A,$C3
B04D LD (HL),A
B04E LD HL,$B14C Draw frame_hero_legs_2 (leg frame 2 data)
B051 CALL draw_frame
B054 RET
draw_hero_legs_1 B055 LD A,$02 Set var_leg_frame = 2
B057 LD ($C34E),A
B05A LD HL,$B0A9 Draw torso frame frame_hero_torso
B05D CALL draw_frame
B060 LD HL,$5C36 Set CHARS to $C420 (leg frame 3 tileset)
B063 LD A,$20
B065 LD (HL),A
B066 INC HL
B067 LD A,$C4
B069 LD (HL),A
B06A LD HL,$B1B5 Draw frame_hero_legs_3 (leg frame 3 data)
B06D CALL draw_frame
B070 RET
draw_hero_legs_2 B071 LD A,$03 Set var_leg_frame = 3
B073 LD ($C34E),A
B076 LD HL,$B0A9 Draw torso frame frame_hero_torso
B079 CALL draw_frame
B07C LD HL,$5C36 Set CHARS to $C538 (leg frame 4 tileset)
B07F LD A,$38
B081 LD (HL),A
B082 INC HL
B083 LD A,$C5
B085 LD (HL),A
B086 LD HL,$B226 Draw frame_hero_legs_4 (leg frame 4 data)
B089 CALL draw_frame
B08C RET
draw_hero_legs_3 B08D LD A,$04 Set var_leg_frame = 4
B08F LD ($C34E),A
B092 LD HL,$B0A9 Draw torso frame frame_hero_torso
B095 CALL draw_frame
B098 LD HL,$5C36 Set CHARS to $C638 (leg frame 5 tileset)
B09B LD A,$38
B09D LD (HL),A
B09E INC HL
B09F LD A,$C6
B0A1 LD (HL),A
B0A2 LD HL,$B299 Draw frame_hero_legs_5 (leg frame 5 data)
B0A5 CALL draw_frame
B0A8 RET
Prev: B001 Up: Map Next: B0A9