Prev: BECB Up: Map Next: BF5B
BED3: Handle bubble bouncing and burst
Used by the routine at BA5C.
BED3 LD A,(IX+$10) Increment graphic data counter for bubble
BED6 INC A
BED7 LD (IX+$10),A
BEDA LD E,A Set HL to the corresponding poisition in graphic data offset table for bubble
BEDB LD D,$00
BEDD LD HL,$BF5B
BEE0 ADD HL,DE
BEE1 LD A,(HL) Set A to the graphic data offset
BEE2 CP $FF is $FF (end marker)?
BEE4 JP NZ,$BEEC Jump forward if not
BEE7 LD (IX+$10),$01 Set graphic data offset counter to 1. Reinit counter
BEEB XOR A Set A=0
BEEC LD E,A Set HL to the graphic data of the bubble
BEED LD D,$00
BEEF LD L,(IX+$12)
BEF2 LD H,(IX+$13)
BEF5 ADD HL,DE
BEF6 LD A,(IX+$06) is bubble falling?
BEF9 OR A
BEFA JP NZ,$BF2A Jump if so
BEFD LD A,(IX+$11) Check bubble counter
BF00 CP $14 is bubble counter < 20?
BF02 JP C,$BF08 Jump forward if so
BF05 JP $BF34 Jump to finish bubble handler
check bubble for burst
BF08 LD A,(IX+$11) check bubble counter
BF0B CP $02 is 2?
BF0D JP Z,$BF55 Jump to set graphic data for bubble final burst (2)
BF10 CP $03 is 3?
BF12 JP Z,$BF4F Jump to set graphic data for bubble burst (3)
BF15 CP $04 is 4?
BF17 JP Z,$BF49 Jump to set graphic data for bubble burst (4)
BF1A CP $05 is 5?
BF1C JP Z,$BF43 Jump to set graphic data for bubble burst (5)
BF1F LD A,(IX+$10) check graphic data counter of bubble
BF22 CP $02 is 2?
BF24 JP NZ,$BF34 Jump forward if not
Bubble stop bouncing
BF27 DEC (IX+$10) Decrement graphic data counter
BF2A LD L,(IX+$12) Increment graphic data to sprite bubble non-bouncing (falling or stopped in floor)
BF2D LD H,(IX+$13)
BF30 LD DE,$0040
BF33 ADD HL,DE
Finish configuring bubble
BF34 LD (IX+$04),L Set corresponding graphic data of bubble
BF37 LD (IX+$05),H
BF3A DEC (IX+$11) Decrement bubble counter
BF3D RET NZ Return if not zero
BF3E LD (IX+$0C),$00 Set dead/non-visible bubble
BF42 RET
BF43 LD HL,$8872 Set HL to graphics data for bubble burst (5)
BF46 JP $BF34 Jump back and finish configuring bubble
BF49 LD HL,$8892 Set HL to graphics data for bubble burst (4)
BF4C JP $BF34 Jump back and finish configuring bubble
BF4F LD HL,$88B2 Set HL to graphics data for bubble burst (3)
BF52 JP $BF34 Jump back and finish configuring bubble
BF55 LD HL,$88D2 Set HL to graphics data for bubble final burst (2)
BF58 JP $BF34 Jump back and finish configuring bubble
Prev: BECB Up: Map Next: BF5B