Prev: B8FC Up: Map Next: B936
B90A: Start Shot At Ship
Used by the routine at LaunchShot.
Gives a new shot the position of the ship, and a horizontal speed of 08 if bit 7 of its type is set or 18 if not. Its vertical speed is the value at ShipRow less the vertical position of the ship.
Input
IX Address of the shot
StartShotAtShip B90A LD A,($C903) The row the ship was drawn on.
B90D LD B,A B=A.
B90E LD A,($5C38) The ship row.
B911 SUB B Subtract B from A.
B912 LD (IX+$09),A Write the high byte of the vertical speed.
B915 LD HL,($C8E6) Fetch the word at C8E6 into HL.
B918 LD DE,($C8E9) Fetch the word at C8E9 into DE.
B91C LD (IX+$01),L Write the map column.
B91F LD (IX+$02),H Write the horizontal position.
B922 LD (IX+$04),E Write the map zone.
B925 LD (IX+$05),D Write the vertical position.
B928 LD (IX+$07),$08 Store 08 at offset 07 of IX.
B92C BIT 7,(IX+$00) Return if bit 7 of offset 00 of IX is set.
B930 RET NZ
B931 LD (IX+$07),$18 Store 18 at offset 07 of IX.
B935 RET Return.
Prev: B8FC Up: Map Next: B936