Prev: BC0B Up: Map Next: BC48
BC17: Draw random attribute color for explosion
Used by the routines at 9BA7 and C059.
BC17 CALL $A6DD Computes into HL the address into the attribute file for the explosion position
BC1A LD DE,$0020 Set this address to the next row
BC1D ADD HL,DE
BC1E LD ($A22C),HL Save at A22C the address into the attribute file
BC21 LD DE,$5800 Set DE the base address for the attribute file
BC24 AND A Reset carry flag
BC25 SBC HL,DE Computes the equivalent address of the attribute file into the attribute buffer
BC27 LD DE,$E4FF
BC2A ADD HL,DE
BC2B EX DE,HL Point A22E to the address into the attribute buffer
BC2C LD ($A22E),DE
BC30 LD A,R Set into DE a pseudo-random number from 0 to 7
BC32 AND $07
BC34 LD E,A
BC35 LD D,$00
BC37 LD HL,$C2DF Set HL to the address into attribute color for explosion
BC3A ADD HL,DE
BC3B LD A,(HL) Set C to the attribute color
BC3C LD C,A
BC3D LD HL,($A22C) Set HL to the address into the attribute file
BC40 LD DE,($A22E) Set DE to the address into the attribute buffer
BC44 CALL $BB9E Draw attribte color for explosion
BC47 RET
Prev: BC0B Up: Map Next: BC48