![]() |
Routines |
| Prev: 979B | Up: Map | Next: 97AE |
|
Looks for an unused entity (one with the type 00) in a run of entities.
|
||||||||||||||||
| FindFreeEntity | 979F | LD DE,$0026 | DE is 26 the size of an entity. | |||||||||||||
| FindFreeEntity_Loop | 97A2 | LD A,(IX+$00) | Fetch the type of the entity. | |||||||||||||
| 97A5 | AND A | Test it. | ||||||||||||||
| 97A6 | RET Z | Return with the zero flag set if the entity is unused. | ||||||||||||||
| 97A7 | ADD IX,DE | Move onto the next entity. | ||||||||||||||
| 97A9 | DJNZ FindFreeEntity_Loop | Decrease the entity counter by one and jump back to FindFreeEntity_Loop until all of the entities have been looked at. | ||||||||||||||
| 97AB | OR %00000001 | Reset the zero flag, as no unused entity was found. | ||||||||||||||
| 97AD | RET | Return. | ||||||||||||||
| Prev: 979B | Up: Map | Next: 97AE |