Prev: B58E Up: Map Next: B67C
B648: Draw the hero car's smoke
Used by the routine at main_loop_24.
draw_smoke B648 RLCA HL = &hero_car_smoke[A] A is 0..3
B649 LD C,A
B64A RLCA
B64B ADD A,C
B64C LD C,A
B64D LD B,$00
B64F LD HL,$CF9A
B652 ADD HL,BC
B653 LD A,($B064) A = *$B064 -- jump counter
B656 AND A Set flags
B657 RET NZ Return if non-zero -- don't draw smoke if jumping
B658 LD C,(HL) C = *HL++ -- these must be size and position
B659 INC HL
B65A LD B,(HL) B = *HL++
B65B INC HL
B65C LD D,(HL) D = *HL++
B65D INC HL
B65E LD E,(HL) E = *HL++
B65F INC HL
B660 LD A,(HL) A = *HL++ -- frame pointer
B661 INC HL
B662 LD H,(HL) H = *HL
B663 LD L,A L = A
B664 PUSH BC
B665 EXX Bank
B666 EX AF,AF'
B667 POP BC
B668 LD B,A B = A
B669 LD E,C E = C
B66A DEC C C--
B66B AND A Set flags
B66C JR NZ,draw_smoke_0 Jump to draw_smoke_0 if non-zero
B66E LD C,A C = A
B66F EXX Unbank
B670 LD A,E A = E
B671 JR draw_smoke_1 Jump to draw_smoke_1
draw_smoke_0 B673 EXX Unbank
B674 LD A,D A = D
draw_smoke_1 B675 ADD A,$7F E = A + 127 -- horizontal position
B677 LD E,A
B678 LD D,$77 D = 119 -- vertical position
B67A JR sub_b67c_3 Exit via sub_b67c_3
Prev: B58E Up: Map Next: B67C