Prev: B648 Up: Map Next: B69E
B67C: Draw the cherry light on the car roof
Picks the light's sprite frame, then draws it via draw_crash_unflipped. The base flicker comes from the bottom bit of the half rate counter. Once turn_speed reaches B the light switches to its turned frames: C is added once when the car is upright and twice when flip_car is set, so the turned frames come in left and right pairs.
Used by the routine at animate_hero_car.
Input
A Base frame index into the cherry light sprites
B Lowest turn_speed that selects the turned frames, e.g. 1
C Frame delta added once, or twice when flipped, e.g. 2
draw_cherry_light B67C LD H,A Take the bottom bit of the half rate counter_C (counts 0/1/2/3 then repeats) and add it to A
B67D LD A,($A236)
B680 AND $01
B682 ADD A,H
B683 EX AF,AF' Bank A
B684 LD A,($A250) Jump to dcl_b698 if turn_speed < B
B687 CP B
B688 JR C,dcl_b698
B68A LD A,($A251) Load flip_car
B68D AND A Set flags
B68E LD A,$00 A = 0
B690 JR Z,dcl_no_flip Jump to dcl_no_flip if flip_car is zero
B692 ADD A,C A += C
dcl_no_flip B693 ADD A,C A += C
B694 LD C,A C = A
B695 EX AF,AF' A' += C
B696 ADD A,C
B697 EX AF,AF'
dcl_b698 B698 EX AF,AF'
This entry point is used by the routine at animate_hero_car.
draw_crash_unflipped B699 EXX BC' = 0 -- not self modified
B69A LD BC,$0000
B69D EXX
FALL THROUGH
Prev: B648 Up: Map Next: B69E