← 9F9D Remove a ball that has passed the bat's losing edge Map A0A1 → Animate the safety net prize's timed barrier (per-frame)
9FFF: Handle the loss of a ball
A real ball B still in play is promoted to ball A, and play continues with no life lost.
On the last ball the player loses a life instead, and the death-and-respawn sequence takes over.
lose_ball 9FFF LD A,(ball_b_in_play) Two balls live and the secondary object a real ball? Promote the survivor.
A002 OR A
A003 JR Z,lose_ball_last
A005 LD A,(missile_shot)
A008 OR A
A009 JR NZ,lose_ball_last
A00B XOR A Clear two-ball mode and the capture slide flag.
A00C LD (ball_b_in_play),A
A00F LD (capture_slide),A
A012 LD IX,obj2_object Deactivate the secondary object, the old ball B object.
A016 RES 0,(IX+$08)
A01A LD HL,ball_b_x_accum Overwrite ball A's ball state record with ball B's.
A01D LD DE,ball_a_x_accum
A020 LD BC,$0010
A023 LDIR
A025 LD A,(ball_b_heading) Carry over ball B's heading and per-ball bytes.
A028 LD (ball_a_heading),A
A02B LD A,(pending_heading_b)
A02E LD (pending_heading_a),A
A031 LD A,(apply_heading_b)
A034 LD (apply_heading_a),A
A037 LD HL,(obj2_object) Move ball A to ball B's screen position. Play continues, no life lost.
A03A LD (ball_a_object),HL
A03D RET
lose_ball_last A03E LD IX,ball_a_object Last ball lost: deactivate every movable pool slot (ball A up through the inhabitants, 9-byte stride).
A042 LD DE,$0009
A045 LD B,$07
lose_ball_0 A047 RES 0,(IX+$08)
A04B ADD IX,DE
A04D DJNZ lose_ball_0
A04F LD A,(expand_active) If the bat is expanded, cancel its grow and arm its shrink, block 6 of the object manager, to retract the bat.
A052 OR A
A053 JR Z,lose_ball_1
A055 XOR A
A056 LD (fx_grow_arm),A
A059 INC A
A05A LD (fx_shrink_arm),A
lose_ball_1 A05D LD A,(missile_active) If the missile-bat is up, cancel the swap to the missile sprite and arm block 3 of the object manager to restore the normal bat.
A060 OR A
A061 JR Z,lose_ball_2
A063 XOR A
A064 LD (fx_bat_missile_arm),A
A067 INC A
A068 LD (fx_bat_normal_arm),A
lose_ball_2 A06B XOR A Zero the active-effect flags (glue, double bat, missile, the secondary object, double score and the rest).
A06C LD (glue_active),A
A06F LD (double_bat_active),A
A072 LD (missile_active),A
A075 LD (missile_shot),A
A078 LD (ball_b_in_play),A
A07B LD (ball_gem_frame),A
A07E LD (glue_release_req),A
A081 LD (double_score),A
A084 LD (bat_sting_freeze),A
A087 LD (capture_slide),A
A08A LD (inhabitant_records+$8),A Zero the type field of each of the five inhabitant records so every inhabitant slot reads as empty and stops.
A08D LD (inhabitant_records+$18),A
A090 LD (inhabitant_records+$28),A
A093 LD (inhabitant_records+$38),A
A096 LD (inhabitant_records+$48),A
A099 INC A Arm the death-and-respawn sequence, block 8 of the object manager.
A09A LD (death_pause_timer),A
A09D CALL lose_life Decrement a life.
A0A0 RET
← 9F9D Remove a ball that has passed the bat's losing edge Map A0A1 → Animate the safety net prize's timed barrier (per-frame)
Fork me on GitHub