Prev: 7198 Up: Map Next: 71D8
71A3: Next Actor
Every actor handler returns here. Moves on to the next actor, and goes back to MainLoop until the last one has been done. After the last actor the game is paused while "SHIFT" is held down, the frame counter at FrameCounter is increased, and the number of actors which were in play is saved in ActorsInPlay_Last. If there are no actors in play and no ingredients are needed then the level is finished. Otherwise the actors are created by CreateActor.
NextActor 71A3 LD DE,$0008 Move on to the next actor by adding 08 to IX.
71A6 ADD IX,DE
71A8 PUSH IX Copy the pointer to the actor into HL, using the stack.
71AA POP HL
Self modifying code; the operand of this command is written as 5F55 by FrameUpdate (for the extra pass over the first four actors) and as 5F85 by ResetModifiedCode (the end of the last actor).
71AB LD BC,$5F85 Fetch the address of the end of the actors (5F85).
71AE AND A Subtract the end of the actors from the pointer.
71AF SBC HL,BC
71B1 JP C,MainLoop Jump to MainLoop if the last actor has not been done yet.
Holding "SHIFT" pauses the game.
NextActor_Pause 71B4 LD A,$FE Read from the keyboard;
Port Number Bit
0 1 2 3 4
FE SHIFT Z X C V
71B6 OUT ($FD),A
71B8 IN A,($FE)
71BA BIT 0,A Jump to NextActor_Pause if key "SHIFT" has been pressed.
71BC JR Z,NextActor_Pause
Self modifying code; this command is changed to JP FrameUpdateEnd by FrameUpdate, to end the extra pass over the first four actors, and is put back by ResetModifiedCode.
NextActor_FrameCounter 71BE LD HL,($5F1D) Fetch the frame counter.
71C1 INC HL Increase the frame counter by one.
71C2 LD ($5F1D),HL Update the frame counter.
71C5 LD A,($5F1B) Fetch the number of actors in play.
71C8 LD ($5F1C),A Remember the number of actors in play for the next pass (ActorsInPlay_Last).
71CB LD B,A Keep the number of actors in play in B.
71CC LD A,($5F2F) Fetch the number of ingredients which the active player needs.
71CF OR B Combine with the number of actors in play.
71D0 JR NZ,CreateActor Jump to CreateActor if there are still actors in play, or ingredients needed.
The level has been finished, so remove all of the actors, and move on to the next level.
71D2 CALL RemoveAllActors Remove all of the actors using RemoveAllActors.
71D5 CALL NextLevel Set up the next level using NextLevel.
Prev: 7198 Up: Map Next: 71D8