Prev: 46211 Up: Map Next: 46629
46517: Draw Shot
Used by the routine at UpdateSpecialShot.
The end of the routines that update a shot. Moves the shot by the vertical scroll speed, then erases the old picture of the shot with EraseRows and draws the new one with DrawRows. If the shot has ended, its slot is made free; if it was a special shot that ends the flag at 47154 is cleared. Otherwise the area of the screen under it is given its attribute by SetShotAttributes.
Input
IX Address of the shot
DrawShot 46517 LD A,(52410) The vertical scroll speed.
46520 ADD A,(IX+12) Add the byte at offset 12 of IX to A.
46523 LD (IX+12),A Write the low byte of the horizontal acceleration.
46526 CALL FindObjectScreenAddress Call FindObjectScreenAddress.
46529 LD B,(IX+14) The high byte of the vertical acceleration.
46532 BIT 7,B Jump to DrawShot_Draw if bit 7 of B is clear.
46534 JR Z,DrawShot_Draw
46536 LD B,0 Clear B.
46538 LD (IX+14),B Write the high byte of the vertical acceleration.
DrawShot_Draw 46541 CALL EraseRows Call EraseRows.
46544 CALL DrawRows Call DrawRows.
46547 CALL MoveObject Call MoveObject.
46550 LD A,(IX+14) The high byte of the vertical acceleration.
46553 AND A Jump to DrawShot_Attributes if A is not zero.
46554 JR NZ,DrawShot_Attributes
46556 LD (IX+11),0 Store 0 at offset 11 of IX.
46560 BIT 7,(IX+21) Return if bit 7 of offset 21 of IX is clear.
46564 RET Z
46565 XOR A Clear A.
46566 LD (47154),A The special shot has ended.
46569 JP AddToStack Jump to AddToStack.
DrawShot_Attributes 46572 BIT 7,(IX+21) Jump to SetShotAttributes if bit 7 of offset 21 of IX is clear.
46576 JR Z,SetShotAttributes
46578 LD A,67 A=67.
46580 LD (44803),A The special shot is bright magenta.
46583 LD L,(IX+11) The high byte of the horizontal acceleration.
46586 LD H,(IX+12) The low byte of the horizontal acceleration.
46589 LD A,(41432) The rows of the shot.
46592 LD D,A D=A.
46593 LD A,(IX+14) The high byte of the vertical acceleration.
46596 ADD A,A Double A.
46597 ADD A,A Double A.
46598 ADD A,A Double A.
46599 LD B,A B=A.
46600 JP SetObjectAttributes_Sum Jump to SetObjectAttributes_Sum.
SetShotAttributes 46603 LD DE,46629 The shot attribute area.
46606 LD A,(IX+14) The high byte of the vertical acceleration.
46609 LD (DE),A Write A where DE points.
46610 INC DE Advance DE.
46611 INC DE Advance DE.
46612 LD A,(IX+13) The attribute.
46615 LD (DE),A Write A where DE points.
46616 LD L,(IX+11) The high byte of the horizontal acceleration.
46619 LD H,(IX+12) The low byte of the horizontal acceleration.
46622 LD DE,46629 The shot attribute area.
46625 CALL FillAttributes Call FillAttributes.
46628 RET Return.
Prev: 46211 Up: Map Next: 46629