Prev: 54173 Up: Map Next: 54294
54203: Check Enemy-Bullet collision
Used by the routine at CHECK_ENEMY_COLLISIONS. IX points at address of 4 byte enemy data block
CHECK_ENEMY_BULLET_COLLISION 54203 LD IY,60093 Point IY at PLAYER_SHOTS
54207 LD B,16 Prepare to loop 16 times to check each bullet
54209 LD DE,3
54212 LD H,(IX+0)
54215 LD L,(IX+1)
CHECK_ENEMY_BULLET_COLLISION_0 54218 LD A,(IY+2) Load A with current bullet's status code
54221 CP 255
54223 JP Z,CHECK_ENEMY_BULLET_COLLISION_2 Jump to 54289 to continue the loop if bullet is disabled
54226 LD A,(IY+0)
54229 CP H
54230 JP C,CHECK_ENEMY_BULLET_COLLISION_2
54233 SUB 4
54235 BIT 7,A
54237 JP NZ,CHECK_ENEMY_BULLET_COLLISION_1
54240 CP H
54241 JP NC,CHECK_ENEMY_BULLET_COLLISION_2
CHECK_ENEMY_BULLET_COLLISION_1 54244 LD A,(IY+1)
54247 ADD A,3
54249 CP L
54250 JP C,CHECK_ENEMY_BULLET_COLLISION_2
54253 SUB 6
54255 CP L
54256 JP NC,CHECK_ENEMY_BULLET_COLLISION_2
54259 LD (IY+2),255 Disable bullet
54263 LD (IX+2),255 Disable enemy
54267 LD D,(IX+0)
54270 LD E,(IX+1)
54273 SRL D
54275 SRL E
54277 PUSH IX
54279 CALL L56342
54282 CALL L56117
54285 POP IX
54287 POP DE
54288 RET
CHECK_ENEMY_BULLET_COLLISION_2 54289 ADD IY,DE
54291 DJNZ CHECK_ENEMY_BULLET_COLLISION_0 Loop 16 times, once for each bullet
54293 RET
Prev: 54173 Up: Map Next: 54294