![]() |
Routines |
| Prev: 9DC0 | Up: Map | Next: 9DF8 |
|
Used by the routines at UpdatePickupEntity and UpdateShotEntity.
Decreases the counter in the high nibble of field 16 of an entity by one. When the counter reaches zero the entity is freed and hidden.
|
||||||||
| DecreaseEntityCounter | 9DDE | LD A,(IX+$16) | Read field 16 of the entity. | |||||
| 9DE1 | AND %11110000 | Keep the counter. | ||||||
| 9DE3 | RET Z | Return if it is zero. | ||||||
| 9DE4 | LD A,(IX+$16) | Read field 16 of the entity. | ||||||
| 9DE7 | SUB $10 | Subtract one from the counter. | ||||||
| 9DE9 | LD (IX+$16),A | Store it. | ||||||
| 9DEC | AND %11110000 | Keep the counter. | ||||||
| 9DEE | RET NZ | Return if it is not zero. | ||||||
| 9DEF | LD (IX+$00),$00 | Set the type of the entity to 00 to free it. | ||||||
| 9DF3 | SET 7,(IX+$01) | Set bit 7 of the frame of the entity, to hide it. | ||||||
| 9DF7 | RET | Return. | ||||||
| Prev: 9DC0 | Up: Map | Next: 9DF8 |