Prev: B322 Up: Map Next: B356
B336: OR a beam onto the screen
Used by the routine at draw_shot.
Draws a shot's beam: B bytes across, for the lines in the last byte of old_sprite_x, from the screen address in HL upwards (line_up_hl), the pattern from DE with its rows 8 bytes apart. ORed onto what is there, so the erase (erase_laser) can take it off again exactly.
Input
B the width in bytes (0: nothing)
DE the pattern
HL the screen address of its bottom left
draw_beam B336 LD A,B nothing to draw; C = the width, A = the lines
B337 AND A
B338 RET Z
B339 LD C,B
B33A LD A,(new_sprite_rows)
draw_beam_0 B33D EX AF,AF' one line: OR the pattern on
B33E LD B,C
B33F PUSH DE
B340 PUSH HL
draw_beam_1 B341 LD A,(DE)
B342 OR (HL)
B343 LD (HL),A
B344 INC L
B345 INC DE
B346 DJNZ draw_beam_1
B348 POP HL the line above
B349 CALL line_up_hl
B34C POP DE the pattern's next row, 8 bytes on
B34D LD A,$08
B34F ADD A,E
B350 LD E,A
B351 EX AF,AF'
B352 DEC A
B353 JR NZ,draw_beam_0
B355 RET
Prev: B322 Up: Map Next: B356