Prev: 9DF8 Up: Map Next: 9E46
9E17: Update Puff Entity
Updates an entity of the type 05. When it is in frame 01 the low nibble of field 23 counts down, and when that runs out the entity is freed.
Input
IX The entity
UpdatePuffEntity 9E17 LD A,(IX+$01) Fetch the frame of the entity.
9E1A AND %00001111 Use bits 0-3.
9E1C DEC A Subtract one.
9E1D JR NZ,UpdatePuffEntity_Test Jump to UpdatePuffEntity_Test unless it is frame 01.
9E1F LD (IX+$10),A Set the speed to 00.
9E22 LD A,(IX+$23) Read field 23 of the entity.
9E25 LD B,A Keep it in B.
9E26 AND %00001111 Keep the low nibble.
9E28 SUB $01 Subtract one.
9E2A JR C,FreeEntity Jump to FreeEntity if it was zero.
9E2C LD C,A Keep the new count in C.
9E2D LD A,B Read field 23 of the entity.
9E2E AND %11110000 Keep the high nibble.
9E30 OR C Combine it with the new count.
9E31 LD (IX+$23),A Store it in field 23 of the entity.
This entry point is used by the routine at UpdateShotEntity.
UpdatePuffEntity_Test 9E34 BIT 7,(IX+$01) Jump to UpdateEntity if bit 7 of the frame of the entity is not set.
9E38 JP Z,UpdateEntity
This entry point is used by the routine at UpdateDomeEntity.
FreeEntity 9E3B LD (IX+$00),$00 Set the type of the entity to 00 to free it.
9E3F SET 7,(IX+$01) Set bit 7 of the frame of the entity, to hide it.
9E43 JP UpdateEntity_Done Jump to UpdateEntity_Done.
Prev: 9DF8 Up: Map Next: 9E46