Prev: 26320 Up: Map Next: 26375
26337: Draw alien explosion
An alien has been hit. Replace its graphic with the explosion graphic.
Used by the routine at alien_hit.
Input
_EXPLOSION_CX_CY Player bullet cx,cy values
_EXPLOSION_GFX_TOP Points to explosion graphic, top half, 2 UDGs wide
_EXPLOSION_GFX_BOTTOM Points to explosion graphic, bottom half, 2 UDGs wide
draw_alien_explosion 26337 LD BC,(_EXPLOSION_CX_CY) Bullet cx,cy, that's the explosion place 26101 is ypos, goes into B, 26100 is xpos goes into C
26341 CALL cxy2saddr cxy2saddr: DE = screen address of char C,B
26344 LD HL,(_EXPLOSION_GFX_TOP) Pick up top row of graphic to draw
26347 CALL draw_alien_explosion_0 Call down to draw the top 2 chars of explosion
26350 LD BC,(_EXPLOSION_CX_CY) Bullet cx,cy, that's the explosion place
26354 INC B inc cy, ready for bottom 2 chars of explosion
Bit of an odd way of moving the graphics bytes into the screen. It uses LDI to do 2 bytes, then restores the registers to put back half of the effects of that instruction.
This entry point is used by the routine at alien_hit.
26355 CALL cxy2saddr cxy2saddr: DE = screen address of char C,B
26358 LD HL,(_EXPLOSION_GFX_BOTTOM) Pick up bottom row of graphic to draw
draw_alien_explosion_0 26361 LD B,8 8 scans
draw_alien_explosion_1 26363 LDI Graphic to screen, left side
26365 LDI Graphic to screen, right side
26367 DEC DE Back up 2 screen bytes
26368 DEC DE
26369 INC BC Restore BC
26370 INC BC
26371 INC D Go down one screen row
26372 DJNZ draw_alien_explosion_1
26374 RET
Prev: 26320 Up: Map Next: 26375