Prev: 8ECA Up: Map Next: 8F54
8F1E: Slow Ship
Used by the routine at ApplyCollisionEffects.
Halves the speed of the player's ship in each direction, unless the speed of the object that was hit is in the opposite direction.
Input
IX Address of the object that was hit
IY Address of the player's object
SlowShip 8F1E LD A,($8CB1) Fetch the value from 8CB1.
8F21 AND A Test it.
8F22 RET NZ Return if it is not zero.
8F23 LD D,(IY+$19) Fetch the horizontal speed of the player into DE.
8F26 LD E,(IY+$1A)
8F29 LD A,D Compare its sign with that of the object.
8F2A XOR (IX+$07)
8F2D BIT 7,A Jump to SlowShip_Vertical if they are different.
8F2F JR NZ,SlowShip_Vertical
8F31 SRA D Halve the horizontal speed...
8F33 RR E
8F35 LD (IY+$19),D ...and store it.
8F38 LD (IY+$1A),E
SlowShip_Vertical 8F3B LD D,(IY+$1B) Fetch the vertical speed of the player into DE.
8F3E LD E,(IY+$1C)
8F41 LD A,D Compare its sign with that of the object.
8F42 XOR (IX+$09)
8F45 BIT 7,A Test bit 7.
8F47 RET NZ Return if they are different.
8F48 SRA D Halve the vertical speed...
8F4A RR E
8F4C LD (IY+$1B),D ...and store it.
8F4F LD (IY+$1C),E
8F52 RET Return.
8F53 DEFB $00
Prev: 8ECA Up: Map Next: 8F54