Prev: 8E26 Up: Map Next: 9147
8F66: Apply Movement
Used by the routine at ControlPlayer.
ApplyMovement 8F66 BIT 4,(IX+$02)
8F6A JR NZ,ApplyMovement_0
8F6C LD A,E
8F6D ADD A,(IX+$03)
8F70 LD (IX+$03),A
ApplyMovement_0 8F73 BIT 5,(IX+$02)
8F77 RET NZ
8F78 LD A,D
8F79 ADD A,(IX+$04)
8F7C LD (IX+$04),A
8F7F RET
This entry point is used by the routine at HandlerKnight.
ApplyMovement_1 8F80 AND A
8F81 JP P,ApplyMovement_2
8F84 NEG
8F86 RRCA
8F87 RRCA
8F88 RRCA
8F89 RRCA
8F8A AND $0F
8F8C NEG
8F8E RET
ApplyMovement_2 8F8F RRCA
8F90 RRCA
8F91 RRCA
8F92 RRCA
8F93 AND $0F
8F95 RET
This entry point is used by the routine at ControlPlayer.
ApplyMovement_3 8F96 LD A,(IX+$02)
8F99 AND $0F
8F9B RET NZ
8F9C LD A,(IX+$06)
8F9F AND A
8FA0 JR Z,ApplyMovement_6
8FA2 JP M,ApplyMovement_9
8FA5 SUB L
8FA6 JP P,ApplyMovement_5
ApplyMovement_4 8FA9 XOR A
ApplyMovement_5 8FAA LD (IX+$06),A
ApplyMovement_6 8FAD LD A,(IX+$07)
8FB0 AND A
8FB1 RET Z
8FB2 JP M,ApplyMovement_10
8FB5 SUB H
8FB6 JP P,ApplyMovement_8
ApplyMovement_7 8FB9 XOR A
ApplyMovement_8 8FBA LD (IX+$07),A
8FBD RET
ApplyMovement_9 8FBE ADD A,L
8FBF JP M,ApplyMovement_5
8FC2 JR ApplyMovement_4
ApplyMovement_10 8FC4 ADD A,H
8FC5 JP M,ApplyMovement_8
8FC8 JR ApplyMovement_7
This entry point is used by the routine at ControlPlayer.
ApplyMovement_11 8FCA PUSH DE
8FCB LD A,E
8FCC ADD A,(IX+$03)
8FCF LD E,A
8FD0 LD D,(IX+$04)
8FD3 LD B,$10
8FD5 CALL ApplyMovement_12
8FD8 POP DE
8FD9 PUSH DE
8FDA LD E,(IX+$03)
8FDD LD A,D
8FDE ADD A,(IX+$04)
8FE1 LD D,A
8FE2 LD B,$20
8FE4 CALL ApplyMovement_12
8FE7 POP DE
8FE8 RET
ApplyMovement_12 8FE9 LD HL,$5E1D
8FEC LD A,E
8FED SUB $58
8FEF JP P,ApplyMovement_13
8FF2 NEG
ApplyMovement_13 8FF4 CP (HL)
8FF5 RET NC
8FF6 INC HL
8FF7 LD A,D
8FF8 SUB $68
8FFA JP P,ApplyMovement_14
8FFD NEG
ApplyMovement_14 8FFF CP (HL)
9000 RET NC
9001 LD A,B
9002 CPL
9003 AND (IX+$02)
9006 LD (IX+$02),A
9009 RET
This entry point is used by the routine at ControlPlayer.
ApplyMovement_15 900A PUSH DE
900B LD A,E
900C ADD A,(IX+$03)
900F LD E,A
9010 LD D,(IX+$04)
9013 LD A,$10
9015 EX AF,AF'
9016 CALL ApplyMovement_16
9019 POP DE
901A PUSH DE
901B LD E,(IX+$03)
901E LD A,D
901F ADD A,(IX+$04)
9022 LD D,A
9023 LD A,$20
9025 EX AF,AF'
9026 CALL ApplyMovement_16
9029 POP DE
902A RET
ApplyMovement_16 902B LD C,(IX+$01)
902E LD B,$00
9030 LD HL,$757D
9033 SLA C
9035 RL B
9037 ADD HL,BC
9038 LD C,(HL)
9039 INC HL
903A LD B,(HL)
ApplyMovement_17 903B LD A,(BC)
903C INC BC
903D LD L,A
903E LD A,(BC)
903F INC BC
9040 LD H,A
9041 OR L
9042 RET Z
9043 PUSH BC
9044 LD BC,$757D
9047 AND A
9048 SBC HL,BC
904A INC HL
904B LD A,(HL)
904C CP (IX+$01)
904F JR Z,ApplyMovement_18
9051 LD BC,$0008
9054 ADD HL,BC
ApplyMovement_18 9055 INC HL
9056 INC HL
9057 LD C,(HL)
9058 INC HL
9059 LD B,(HL)
905A INC HL
905B LD A,(HL)
905C INC HL
905D BIT 2,A
905F JR NZ,ApplyMovement_21
9061 BIT 3,A
9063 JR NZ,ApplyMovement_20
9065 LD A,(HL)
9066 SRA A
9068 SRA A
906A AND $FC
906C ADD A,C
906D SUB E
906E NEG
9070 LD C,A
9071 LD A,(HL)
9072 RLCA
9073 RLCA
9074 AND $3C
9076 INC HL
9077 CP C
9078 JR C,ApplyMovement_20
907A LD A,(HL)
907B SRA A
907D SRA A
907F AND $FC
9081 ADD A,B
9082 SUB D
9083 LD B,A
9084 LD A,(HL)
9085 INC HL
9086 RLCA
9087 RLCA
9088 AND $3C
908A CP B
908B JR C,ApplyMovement_20
908D EX AF,AF'
908E LD C,A
908F EX AF,AF'
9090 LD A,C
9091 CPL
9092 AND (IX+$02)
ApplyMovement_19 9095 LD (IX+$02),A
ApplyMovement_20 9098 POP BC
9099 JR ApplyMovement_17
ApplyMovement_21 909B LD A,(HL)
909C SRA A
909E SRA A
90A0 AND $FC
90A2 ADD A,C
90A3 SUB E
90A4 NEG
90A6 LD C,A
90A7 LD A,(HL)
90A8 RLCA
90A9 RLCA
90AA AND $3C
90AC INC HL
90AD CP C
90AE JR C,ApplyMovement_20
90B0 LD A,(HL)
90B1 SRA A
90B3 SRA A
90B5 AND $FC
90B7 ADD A,B
90B8 SUB D
90B9 LD B,A
90BA LD A,(HL)
90BB INC HL
90BC RLCA
90BD RLCA
90BE AND $3C
90C0 CP B
90C1 JR C,ApplyMovement_20
90C3 EX AF,AF'
90C4 LD C,A
90C5 EX AF,AF'
90C6 LD A,C
90C7 OR (IX+$02)
90CA JR ApplyMovement_19
This entry point is used by the routines at HandlerDoorExit, HandlerRoomItem and GameComplete.
ApplyMovement_22 90CC LD A,($EA92)
90CF AND $0F
90D1 RET NZ
90D2 LD A,($EA90)
90D5 DEC A
90D6 CP $30
90D8 RET NC
90D9 BIT 6,(IX+$05)
90DD JR Z,ApplyMovement_23
90DF SRL C
ApplyMovement_23 90E1 LD A,($EA93)
90E4 SUB (IX+$03)
90E7 CP C
90E8 RET NC
90E9 BIT 6,(IX+$05)
90ED JR NZ,ApplyMovement_24
90EF SRL B
ApplyMovement_24 90F1 LD A,($EA94)
90F4 SUB (IX+$04)
90F7 NEG
90F9 CP B
90FA RET
This entry point is used by the routines at HandlerFoodItem, HandlerCaveDoorLocked and GameComplete.
ApplyMovement_25 90FB LD A,($EA93)
90FE SUB (IX+$03)
9101 JP P,ApplyMovement_26
9104 NEG
ApplyMovement_26 9106 CP $0C
9108 RET NC
9109 LD A,($EA94)
910C SUB (IX+$04)
910F JP P,ApplyMovement_27
9112 NEG
ApplyMovement_27 9114 CP $0C
9116 RET
This entry point is used by the routines at HandlerDoorExit, HandlerDoorLocked and GameComplete.
ApplyMovement_28 9117 CALL HandlerCaveDoorLocked_5
911A LD A,(IX+$01)
911D LD ($EA91),A
9120 LD A,(IX+$02)
9123 RLCA
9124 AND $1E
9126 ADD A,(IX+$03)
9129 LD ($EA93),A
912C LD A,(IX+$02)
912F RRCA
9130 RRCA
9131 RRCA
9132 AND $1E
9134 NEG
9136 ADD A,(IX+$04)
9139 LD ($EA94),A
913C CALL GameComplete_12
913F LD A,($EA92)
9142 OR $0F
9144 LD ($EA92),A
Prev: 8E26 Up: Map Next: 9147