Prev: C141 Up: Map Next: C253
C1CB: Handle bubble bouncing and burst
Used by the routine at BC48.
C1CB LD A,(IX+$10) Increment graphic data counter for bubble
C1CE INC A
C1CF LD (IX+$10),A
C1D2 LD E,A Set HL to the corresponding poisition in graphic data offset table for bubble
C1D3 LD D,$00
C1D5 LD HL,$C253
C1D8 ADD HL,DE
C1D9 LD A,(HL) Set A to the graphic data offset
C1DA CP $FF is $FF (end marker)?
C1DC JP NZ,$C1E4 Jump forward if not
C1DF LD (IX+$10),$01 Set graphic data offset counter to 1. Reinit counter
C1E3 XOR A Set A=0
C1E4 LD E,A Set HL to the graphic data of the bubble
C1E5 LD D,$00
C1E7 LD L,(IX+$12)
C1EA LD H,(IX+$13)
C1ED ADD HL,DE
C1EE LD A,(IX+$06) is bubble falling?
C1F1 OR A
C1F2 JP NZ,$C222 Jump if so
C1F5 LD A,(IX+$11) Check bubble counter
C1F8 CP $14 is bubble counter < 20?
C1FA JP C,$C200 Jump forward if so
C1FD JP $C22C Jump to finish bubble handler
check bubble for burst
C200 LD A,(IX+$11) check bubble counter
C203 CP $02 is 2?
C205 JP Z,$C24D Jump to set graphic data for bubble final burst (2)
C208 CP $03 is 3?
C20A JP Z,$C247 Jump to set graphic data for bubble burst (3)
C20D CP $04 is 4?
C20F JP Z,$C241 Jump to set graphic data for bubble burst (4)
C212 CP $05 is 5?
C214 JP Z,$C23B Jump to set graphic data for bubble burst (5)
C217 LD A,(IX+$10) check graphic data counter of bubble
C21A CP $02 is 2?
C21C JP NZ,$C22C Jump forward if not
Bubble stop bouncing
C21F DEC (IX+$10) Decrement graphic data counter
C222 LD L,(IX+$12) Increment graphic data to sprite bubble non-bouncing (falling or stopped in floor)
C225 LD H,(IX+$13)
C228 LD DE,$0040
C22B ADD HL,DE
Finish configuring bubble
C22C LD (IX+$04),L Set corresponding graphic data of bubble
C22F LD (IX+$05),H
C232 DEC (IX+$11) Decrement bubble counter
C235 RET NZ Return if not zero
C236 LD (IX+$0C),$00 Set dead/non-visible bubble
C23A RET
C23B LD HL,$8898 Set HL to graphics data for bubble burst (5)
C23E JP $C22C Jump back and finish configuring bubble
C241 LD HL,$88B8 Set HL to graphics data for bubble burst (4)
C244 JP $C22C Jump back and finish configuring bubble
C247 LD HL,$88D8 Set HL to graphics data for bubble burst (3)
C24A JP $C22C Jump back and finish configuring bubble
C24D LD HL,$88F8 Set HL to graphics data for bubble final burst (2)
C250 JP $C22C Jump back and finish configuring bubble
Prev: C141 Up: Map Next: C253