Prev: 39338 Up: Map Next: 39453
39408: Next Actor
Moves on to the next actor in the actor table. If a new frame has just started only the player's actor is processed before the interrupted pass carries on; otherwise the loop runs until the end of the actor table is reached.
NextActor 39408 LD DE,12 Set the size of an actor record in DE to 12.
39411 ADD IX,DE Move onto the next actor.
39413 PUSH IX Copy the actor pointer to HL (using the stack).
39415 POP HL
39416 LD A,(38551) Fetch the frame updated flag from FrameUpdated.
39419 AND A Jump to NextActor_FrameUpdated if the frame has just updated.
39420 JR NZ,NextActor_FrameUpdated
39422 LD DE,38958 Point DE at the end of the actor table at StoredActorTable.
NextActor_Compare 39425 AND A Subtract the end of the actor table from the actor pointer.
39426 SBC HL,DE
39428 JR C,MainLoop_NextActor Jump to MainLoop_NextActor if there are more actors to process.
The end of the range has been reached. If this was just the player's actor then go back to where the interrupted pass left off; otherwise the pass through the actor table is complete.
39430 LD A,(38551) Fetch the frame updated flag from FrameUpdated.
39433 AND A Jump to UpdateCounters if the frame has not just updated (every actor has been processed).
39434 JR Z,UpdateCounters
39436 LD IX,(38569) Restore the actor which was being processed before the frame updated from SavedActorPointer.
39440 XOR A Clear the frame updated flag in FrameUpdated.
39441 LD (38551),A
39444 EI Enable interrupts.
39445 JP MainLoop_NextActor Jump to MainLoop_NextActor.
The frame has just updated, so only the player's actor is processed before the interrupted pass is resumed (i.e. stop once IX reaches the second actor).
NextActor_FrameUpdated 39448 LD DE,38670 Point DE at the second actor record at ImmortalData_Actors.
39451 JR NextActor_Compare Jump to NextActor_Compare.
Prev: 39338 Up: Map Next: 39453