Prev: 8D6D Up: Map Next: 8DC4
8D77: Control Player
Used by the routines at HandlerWizard, HandlerSerf and HandlerKnight.
ControlPlayer 8D77 LD A,($EA91) A=PlayerRoom.
8D7A LD ($EE59),A
8D7D PUSH BC Stash BC, DE and HL on the stack.
8D7E PUSH DE
8D7F PUSH HL
8D80 CALL AutoWalkStep Call AutoWalkStep.
8D83 LD A,(IX+$02)
8D86 OR %00110000 Set bits 4-5.
8D88 LD (IX+$02),A
8D8B CALL StoreEntity Call StoreEntity.
8D8E CALL HandlerCaveDoorLocked_20 Call HandlerCaveDoorLocked_20.
8D91 LD C,A
8D92 POP HL Restore HL from the stack.
8D93 LD DE,$0000 DE=0000.
8D96 BIT 1,C
8D98 JR NZ,ControlPlayer_0
8D9A LD A,B
8D9B NEG
8D9D LD E,A
ControlPlayer_0 8D9E BIT 0,C
8DA0 JR NZ,ControlPlayer_1
8DA2 LD E,B
ControlPlayer_1 8DA3 BIT 2,C
8DA5 JR NZ,ControlPlayer_2
8DA7 LD D,B
ControlPlayer_2 8DA8 BIT 3,C
8DAA JR NZ,ControlPlayer_3
8DAC LD A,B
8DAD NEG
8DAF LD D,A
ControlPlayer_3 8DB0 POP HL Restore HL from the stack.
8DB1 CALL ApplyMovement_3 Call ApplyMovement_3.
8DB4 POP HL Restore HL from the stack.
8DB5 CALL HandlerKnight_14 Call HandlerKnight_14.
8DB8 CALL ApplyMovement_11 Call ApplyMovement_11.
8DBB CALL CheckDoorway Call CheckDoorway.
8DBE CALL ApplyMovement_15 Call ApplyMovement_15.
8DC1 JP ApplyMovement Jump to ApplyMovement.
Prev: 8D6D Up: Map Next: 8DC4