Prev: 9739 Up: Map Next: 97AB
976E: Destroy an enemy if smartbomb released or Rex dead
Used by the routine at 9470.
976E LD A,($A1C9) Return if Destroy all enemies not activated
9771 OR A
9772 RET Z
9773 LD IX,($A1CA) Set IX the address pointer into enemy configuration buffer for the next enemy to be destroyed
9777 LD A,(IX+$09) Check enemy type
977A CP $FE Jump to check next enemy if enemy type is bubble, smartbomb, question or boss. BOSS enemy not used in Rex (Side B)
977C JP Z,$9791
977F CP $FD
9781 JP Z,$9791
9784 CP $FC
9786 JP Z,$9791
9789 CP $90
978B JP Z,$9791
978E CALL $9807 Destroy enemy
9791 LD DE,$001B Point address to the next enemy
9794 ADD IX,DE
9796 LD ($A1CA),IX
979A LD A,($A1C8) Decrement the max number of enemies to be destroyed
979D DEC A
979E LD ($A1C8),A
97A1 OR A Return if is not zero
97A2 RET NZ
97A3 XOR A Inactive destroy all enemies if max number of enemies destroyed has been reached
97A4 LD ($A1C9),A
97A7 CALL $C932 Copy room color attribute buffer to attribute file
97AA RET
Prev: 9739 Up: Map Next: 97AB