Prev: B483 Up: Map Next: B625
B5B5: 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 B832 is cleared. Otherwise the area of the screen under it is given its attribute by SetShotAttributes.
Input
IX Address of the shot
DrawShot B5B5 LD A,($CCBA) The vertical scroll speed.
B5B8 ADD A,(IX+$0C) Add the byte at offset 0C of IX to A.
B5BB LD (IX+$0C),A Write the low byte of the horizontal acceleration.
B5BE CALL FindObjectScreenAddress Call FindObjectScreenAddress.
B5C1 LD B,(IX+$0E) The high byte of the vertical acceleration.
B5C4 BIT 7,B Jump to DrawShot_Draw if bit 7 of B is clear.
B5C6 JR Z,DrawShot_Draw
B5C8 LD B,$00 Clear B.
B5CA LD (IX+$0E),B Write the high byte of the vertical acceleration.
DrawShot_Draw B5CD CALL EraseRows Call EraseRows.
B5D0 CALL DrawRows Call DrawRows.
B5D3 CALL MoveObject Call MoveObject.
B5D6 LD A,(IX+$0E) The high byte of the vertical acceleration.
B5D9 AND A Jump to DrawShot_Attributes if A is not zero.
B5DA JR NZ,DrawShot_Attributes
B5DC LD (IX+$0B),$00 Store 00 at offset 0B of IX.
B5E0 BIT 7,(IX+$15) Return if bit 7 of offset 15 of IX is clear.
B5E4 RET Z
B5E5 XOR A Clear A.
B5E6 LD ($B832),A The special shot has ended.
B5E9 JP AddToStack Jump to AddToStack.
DrawShot_Attributes B5EC BIT 7,(IX+$15) Jump to SetShotAttributes if bit 7 of offset 15 of IX is clear.
B5F0 JR Z,SetShotAttributes
B5F2 LD A,$43 A=43.
B5F4 LD ($AF03),A The special shot is bright magenta.
B5F7 LD L,(IX+$0B) The high byte of the horizontal acceleration.
B5FA LD H,(IX+$0C) The low byte of the horizontal acceleration.
B5FD LD A,($A1D8) The rows of the shot.
B600 LD D,A D=A.
B601 LD A,(IX+$0E) The high byte of the vertical acceleration.
B604 ADD A,A Double A.
B605 ADD A,A Double A.
B606 ADD A,A Double A.
B607 LD B,A B=A.
B608 JP SetObjectAttributes_Sum Jump to SetObjectAttributes_Sum.
SetShotAttributes B60B LD DE,$B625 The shot attribute area.
B60E LD A,(IX+$0E) The high byte of the vertical acceleration.
B611 LD (DE),A Write A where DE points.
B612 INC DE Advance DE.
B613 INC DE Advance DE.
B614 LD A,(IX+$0D) The attribute.
B617 LD (DE),A Write A where DE points.
B618 LD L,(IX+$0B) The high byte of the horizontal acceleration.
B61B LD H,(IX+$0C) The low byte of the horizontal acceleration.
B61E LD DE,$B625 The shot attribute area.
B621 CALL FillAttributes Call FillAttributes.
B624 RET Return.
Prev: B483 Up: Map Next: B625