Prev: AB38 Up: Map Next: AB72
AB53: Deallocate sprite from map
Search for sprite pattern in map and deallocate if found. Used by the routines at shot_hit_sprite_enemy and ship_hit_enemy.
Input
IX sprite data
deallocate_sprite_from_map AB53 BIT 6,(IX+$07) Test bit
AB57 RET Z Return if not set
AB58 PUSH HL
AB59 PUSH BC
AB5A LD HL,center_enemy_map Map address
AB5D LD B,$24 Size of map
AB5F LD A,(IX+$0A) Get sprite pattern
AB62 OR $80 Set bit 7
deallocate_sprite_from_map_0 AB64 CP (HL) Compare with map entry
AB65 JR Z,deallocate_sprite_from_map_1 Break out if found
AB67 INC HL Next map address
AB68 DJNZ deallocate_sprite_from_map_0 Loop through whole map
AB6A JR deallocate_sprite_from_map_2 Not found - return
deallocate_sprite_from_map_1 AB6C CALL deallocate_map_entry Deallocate map entry
deallocate_sprite_from_map_2 AB6F POP BC
AB70 POP HL
AB71 RET
Prev: AB38 Up: Map Next: AB72