Prev: BF5B Up: Map Next: BFE7
BF66: Handle explosion debris movement and draw it
Used by the routine at BD6B.
BF66 LD A,R Border color to black?
BF68 SLA A
BF6A AND $F8
BF6C OUT ($FE),A
BF6E LD A,(IX+$03) Set A to the explosion counter
BF71 SLA A Save at A093 the position of the offset for the current explosion counter
BF73 LD ($A093),A
BF76 LD E,A Point HL to the corresponent address into offset of debris position
BF77 LD D,$00
BF79 ADD HL,DE
BF7A LD A,(IX+$00) Computes the x-byte-position in room of the debris
BF7D SRL A
BF7F SRL A
BF81 SRL A
BF83 ADD A,(HL)
BF84 SUB $07
BF86 CP $01 Position is out of bounds of the screen-left border?
BF88 JP C,$BFCF Jump forward is so
BF8B CP $1E Position is out of bounds of the screen-right border?
BF8D JP NC,$BFCF Jump forward if so
BF90 LD ($A0AF),A Set A0AF the x-byte-position of the debris
BF93 INC HL Computes the y-pixel-position in room of the debris
BF94 LD A,(HL)
BF95 ADD A,(IX+$01)
BF98 SUB $30
BF9A CP $08 Position is out of bounds of the screen-top border?
BF9C JP C,$BFDB Jump forward is so
BF9F CP $A0 Position is out of bounds of the screen-bottom border?
BFA1 JP NC,$BFDB Jump forward is so
BFA4 LD ($A0B0),A Set A0B0 the y-pixel-position of the debris
BFA7 LD L,A Compute into HL the address of the debris into the room graphic data
BFA8 LD H,$00
BFAA ADD HL,HL
BFAB ADD HL,HL
BFAC ADD HL,HL
BFAD ADD HL,HL
BFAE ADD HL,HL
BFAF LD A,($A0AF)
BFB2 LD E,A
BFB3 LD D,$00
BFB5 ADD HL,DE
BFB6 LD DE,$EAFF
BFB9 ADD HL,DE
BFBA PUSH HL Save HL
BFBB LD A,($A093) Compute into DE the address for the graphic data of the debris
BFBE SLA A
BFC0 SLA A
BFC2 LD E,A
BFC3 LD D,$00
BFC5 LD HL,$AA6E
BFC8 ADD HL,DE
BFC9 EX DE,HL
BFCA POP HL Restore HL
BFCB CALL $A4F4 Draw the debris
BFCE RET
BFCF XOR A Set A=0
BFD0 LD ($A0AF),A Set x-byte-position of the debris to 0
BFD3 LD A,$20 Set y-pixel-position of the debris to $20
BFD5 LD ($A0B0),A
BFD8 JP $BF90 Jump back
BFDB LD A,$20 Set y-pixel-position of the debris to $20
BFDD LD ($A0B0),A
BFE0 XOR A Set A=0
BFE1 LD ($A0AF),A Set x-byte-position of the debris to 0
BFE4 JP $BFA4 Jump back
Prev: BF5B Up: Map Next: BFE7