Prev: CAF6 Up: Map Next: CB77
CB41: Configure static enemies for the current room
Used by the routine at A939.
CB41 LD HL,$5E66 Reset enemy configuration buffer for the room
CB44 LD DE,$5E67
CB47 LD BC,$0179
CB4A LD (HL),$00
CB4C LDIR
CB4E LD B,$0E Set B to the max. number of static enemies per room
CB50 LD IX,$5E66 Set IX to the base addres for the enemy configuration buffer
CB54 LD IY,($A1B9) Set IY to the address for the static enemy definition of the current room
CB58 PUSH BC Save BC
CB59 LD A,(IY+$00) Pick up the first byte of the static enemy defintion
CB5C CP $FF is end of marker - no more enemies?
CB5E JP Z,$CB75 Jump forward and return
CB61 CALL $CB77 Configure the current enemy
CB64 INC IY Point IY to the next enemy defintion
CB66 INC IY
CB68 INC IY
CB6A LD DE,$001B Point IX to the next address for the enemy configuration buffer
CB6D ADD IX,DE
CB6F POP BC Recover and decrement counter at BC
CB70 DEC B
CB71 JP NZ,$CB58 Jump while there are static enemies to configure
CB74 RET
CB75 POP BC Recover BC
CB76 RET
Prev: CAF6 Up: Map Next: CB77