Prev: 9572 Up: Map Next: 9724
96D8: Update Type 15 Object
The code for an object of type 15, which is run by RunObjectHandler. The speeds of the object follow the table at ExplosionSpeeds, which ends with 80.
Input
IX Address of the object
UpdateType15 96D8 XOR A Clear the collision effects in 8E2C.
96D9 LD ($8E2C),A
96DC CALL PlayObjectWarble Play a sound.
96DF LD A,(IX+$15) Fetch the lifetime of the object.
96E2 AND %00111111 Keep the bottom six bits.
96E4 LD HL,$9873 Use the table at ExplosionSpeeds.
96E7 CALL AddAToHL Add the offset to the address.
96EA LD A,(HL) Fetch the horizontal speed from the table.
96EB CP $80 Jump to UpdateType15_Speed if it is not the end of the table.
96ED JR NZ,UpdateType15_Speed
96EF LD (IX+$00),$FF Free the slot.
96F3 JP UpdateType14_Draw Jump to UpdateType14_Draw.
UpdateType15_Speed 96F6 LD (IX+$07),A Set the horizontal speed of the object.
96F9 INC HL Fetch the vertical speed from the table.
96FA LD A,(HL)
96FB LD (IX+$09),A Set the vertical speed of the object.
96FE INC (IX+$15) Move two steps along the table.
9701 INC (IX+$15)
9704 BIT 7,(IX+$15) Jump to UpdateType15_Vertical if bit 7 of the lifetime of the object is clear.
9708 JR Z,UpdateType15_Vertical
970A LD A,(IX+$07) Reverse the horizontal speed.
970D NEG
970F LD (IX+$07),A
UpdateType15_Vertical 9712 BIT 6,(IX+$15) Jump to UpdateType14_Step if bit 6 of the lifetime of the object is clear.
9716 JP Z,UpdateType14_Step
9719 LD A,(IX+$09) Reverse the vertical speed.
971C NEG
971E LD (IX+$09),A
9721 JP UpdateType14_Step Jump to UpdateType14_Step.
Prev: 9572 Up: Map Next: 9724