Prev: 57804 Up: Map Next: 58476
58334: Handler: Actors
Used by the routine at Dispatch_Handlers.
Animates the 13-byte records at *ReferenceActors.
Handler_Actors 58334 CALL Build_PlayerMask Call Build_PlayerMask.
58337 LD IX,(25648) IX=*ReferenceActors.
Handler_Actors_Loop 58341 LD A,(IX+0) Return if the terminator 255 is reached.
58344 INC A
58345 RET Z
58346 BIT 7,A Jump to Handler_Actors_Next if this actor is inactive.
58348 JR NZ,Handler_Actors_Next
Test this actor against the player.
58350 PUSH IY Stash IY on the stack.
58352 PUSH IX Copy IX to IY (using the stack).
58354 POP IY
58356 CALL Test_ActorCollision Call Test_ActorCollision.
58359 POP IY Restore IY from the stack.
58361 CALL JumpTable_UpdateActor Call JumpTable_UpdateActor.
58364 BIT 7,(IX+7) Restore the stored row when bit 7 of *IX+7 is set.
58368 JR Z,Handler_Actors_Commit
58370 RES 7,(IX+7)
58374 LD A,(IX+11)
58377 LD (IX+1),A
Store the new position.
Handler_Actors_Commit 58380 CALL JumpTable_AdvanceEntity Call JumpTable_AdvanceEntity.
58383 LD (IX+0),C Store the new column, row, fine-X and fine-Y.
58386 LD (IX+1),B
58389 LD (IX+2),E
58392 LD (IX+3),D
58395 CALL JumpTable_DrawActor Call JumpTable_DrawActor.
Handler_Actors_Next 58398 LD DE,13 IX+=0013.
58401 ADD IX,DE
58403 JR Handler_Actors_Loop Jump to Handler_Actors_Loop.
58405 RET Return.
Lock or reverse an actor after a collision.
Actor_AfterCollision 58406 CP 2 Jump to Actor_Lock if the actor type is 2.
58408 JP Z,Actor_Lock
58411 CALL Actor_SwapDestination Call Actor_SwapDestination.
58414 XOR A Write 0 to both actor deltas.
58415 LD (IY+8),A
58418 LD (IY+9),A
58421 RET Return.
Actor_Lock 58422 SET 7,(IY+7) Set bit 7 of *IY+7.
58426 RET Return.
This entry point is used by the routine at Handler_PendulumRooms.
Actor_Reverse 58427 LD A,(IY+12) Jump to Actor_AfterCollision if *IY+12 is set.
58430 OR A
58431 JR NZ,Actor_AfterCollision
Actor_SwapDestination 58433 LD A,(IY+5) Swap *IY+5 with *IY+10.
58436 LD C,(IY+10)
58439 LD (IY+5),C
58442 LD (IY+10),A
58445 LD A,(IY+6) Swap *IY+6 with *IY+11.
58448 LD C,(IY+11)
58451 LD (IY+11),A
58454 LD (IY+6),C
58457 LD A,(IY+8) A=*IY+8-1.
58460 DEC A
58461 XOR %11111111 Invert every bit.
58463 LD (IY+8),A Write the new horizontal delta.
58466 LD A,(IY+9) A=*IY+9-1.
58469 DEC A
58470 XOR %11111111 Invert every bit.
58472 LD (IY+9),A Write the new vertical delta.
58475 RET Return.
Prev: 57804 Up: Map Next: 58476