Prev: 31198 Up: Map Next: 31290
31257: Draw an alien sprite scan line
This fills in a scan line of alien graphics, i.e. one pixel of the graphic data, drawn left to right. It zeroes out the left margin (width depending on how far the currently being drawn aliens have moved to the right) then fills in the bank of aliens (width depending on how many of the side aliens have been killed). It then zeroes out the right margin.
Used by the routine at print_alien_row.
Input
_SPRITE_SCR_DEST Screen address to draw to
_ALIEN_SPRITE_DATA_PTR Sprite data to use
_ALIEN_ROW_LEFT_MARGIN Number of left side scans to zero
_ALIEN_ROW_BANK_WIDTH Number of alien scans to draw
_ALIEN_ROW_RIGHT_MARGIN Number of right side scans to zero
draw_alien_sprite_scan 31257 LD DE,(_SPRITE_SCR_DEST) Screen address from here
31261 LD A,(_ALIEN_ROW_LEFT_MARGIN) A is number of left side bytes to zero out
31264 CALL zero_alien_sprite_scan Zero those bytes from DE
31267 LD HL,(_ALIEN_SPRITE_DATA_PTR) HL is sprite data
31270 LD BC,(_ALIEN_ROW_BANK_WIDTH) C is number of alien scans to draw
31274 LD B,0
31276 LDIR DE is end of zeroed bytes, draw from there across screen
31278 LD A,(_ALIEN_ROW_RIGHT_MARGIN) Pick up right side scans to zero out and drop through
Called from just above. Takes in A a count of consecutive bytes at DE which it writes 0 into
zero_alien_sprite_scan 31281 OR A If A is zero don't bother
31282 RET Z
31283 LD B,A Byte counter comes from A
31284 XOR A We're writing zeroes
draw_alien_sprite_scan_0 31285 LD (DE),A Fill with zeroes from DE onwards
31286 INC DE
31287 DJNZ draw_alien_sprite_scan_0
31289 RET Back with DE pointing to next byte
Prev: 31198 Up: Map Next: 31290