Prev: 9751 Up: Map Next: 97C3
9786: Destroy an enemy if smartbomb released or Rex dead
Used by the routine at 947A.
9786 LD A,($A030) Return if Destroy all enemies not activated
9789 OR A
978A RET Z
978B LD IX,($A031) Set IX the address pointer into enemy configuration buffer for the next enemy to be destroyed
978F LD A,(IX+$09) Check enemy type
9792 CP $FE Jump to check next enemy if enemy type is bubble, smartbomb, question or boss
9794 JP Z,$97A9
9797 CP $FD
9799 JP Z,$97A9
979C CP $FC
979E JP Z,$97A9
97A1 CP $90
97A3 JP Z,$97A9
97A6 CALL $981F Destroy enemy
97A9 LD DE,$0018 Point address to the next enemy
97AC ADD IX,DE
97AE LD ($A031),IX
97B2 LD A,($A02F) Decrement the max number of enemies to be destroyed
97B5 DEC A
97B6 LD ($A02F),A
97B9 OR A Return if is not zero
97BA RET NZ
97BB XOR A Inactive destroy all enemies if max number of enemiies destroyed has been reached
97BC LD ($A030),A
97BF CALL $C8BF Copy room color attribute buffer to attribute file
97C2 RET
Prev: 9751 Up: Map Next: 97C3