![]() |
Routines |
Prev: 31119 | Up: Map | Next: 31257 |
Display a single row of aliens, the subroutine this calls displaying one scan line at a time. This code does 8 scan lines, which is the top half of the alien graphic data, then does it again with the bottom half of the alien graphic data.
Used by the routines at move_one_row_aliens_down and init_draw_aliens.
|
||||
print_alien_row | 31198 | CALL set_alien_colour_band | Set attribute band on screen | |
31201 | LD BC,(_NEXT_ALIEN_ROW_TO_DRAW) | Start with the top part of the UDG, the alien's heads as it were, Call down. | ||
31205 | CALL print_alien_row_0 | |||
31208 | LD BC,(_NEXT_ALIEN_ROW_TO_DRAW) | Back here, so do same again with B++, which does the feet. Drop through and out this time | ||
31212 | INC B | |||
print_alien_row_0 | 31213 | LD A,8 | 8 scans, that's half an alien, vertically speaking 16 pixel high sprites | |
31215 | LD (_SPRITE_DRAW_SCAN_COUNTER),A | |||
31218 | LD C,0 | cx, start at extreme left | ||
31220 | CALL cxy2saddr | DE = screen address of cy,cx | ||
31223 | LD (_SPRITE_SCR_DEST),DE | This variable holds the left side address of the screen scan line | ||
print_alien_row_1 | 31227 | CALL draw_alien_sprite_scan | Takes _SPRITE_SCR_DEST as screen location to draw to. Takes _ALIEN_SPRITE_DATA_PTR as sprite data to fill in. Takes _ALIEN_ROW_LEFT_MARGIN as width of left margin to zero. Takes _ALIEN_ROW_BANK_WIDTH as width of alien bank. Takes _ALIEN_ROW_RIGHT_MARGIN as width of right margin to zero. | |
31230 | LD HL,(_ALIEN_SPRITE_DATA_PTR) | Pick up data pointer and add 22 bytes to it. 22 chars is 11 aliens, each 2 chars wide. i.e. this advances the alien sprite data ready for displaying the next scan line. | ||
31233 | LD BC,22 | |||
31236 | ADD HL,BC | |||
31237 | LD (_ALIEN_SPRITE_DATA_PTR),HL | |||
31240 | LD HL,(_SPRITE_SCR_DEST) | Next scan down | ||
31243 | INC H | |||
31244 | LD (_SPRITE_SCR_DEST),HL | |||
31247 | LD A,(_SPRITE_DRAW_SCAN_COUNTER) | One more scan drawn | ||
31250 | DEC A | |||
31251 | LD (_SPRITE_DRAW_SCAN_COUNTER),A | |||
31254 | JR NZ,print_alien_row_1 | Back for the next of the 8 we do here | ||
31256 | RET |
Prev: 31119 | Up: Map | Next: 31257 |