Prev: EB8D Up: Map Next: ED35
EBD8: Handler: Player
Used by the routine at InitialiseGame.
Handler_Player EBD8 LD IX,$F231 IX=TablePlayerAttributes.
EBDC LD A,$10 Set INK: CYAN (05).
EBDE RST $10
EBDF LD A,$05
EBE1 RST $10
EBE2 XOR A Write 00 to *F32F.
EBE3 LD ($F32F),A
EBE6 LD A,($E820) Jump to Handler_Player_2 if *E820 is not equal to 00.
EBE9 CP $00
EBEB JR NZ,Handler_Player_2
EBED LD A,(IX+$11) Jump to Handler_Player_2 if *IX+11 is equal to 03.
EBF0 CP $03
EBF2 JR Z,Handler_Player_2
EBF4 LD A,(IX+$05) Jump to Handler_Player_2 if *IX+05 is not equal to 00.
EBF7 CP $00
EBF9 JR NZ,Handler_Player_2
EBFB LD A,(IX+$03) Jump to Handler_Player_1 if *IX+03 is not equal to 03.
EBFE CP $03
EC00 JP NZ,Handler_Player_1
EC03 LD A,(IX+$01) Jump to Handler_Player_0 if *IX+01 is equal to 1A.
EC06 CP $1A
EC08 JR Z,Handler_Player_0
EC0A CP $15 Jump to Handler_Player_0 if *IX+01 is equal to 15.
EC0C JR Z,Handler_Player_0
EC0E CP $10 Jump to Handler_Player_0 if *IX+01 is equal to 10.
EC10 JR Z,Handler_Player_0
EC12 CP $0B Jump to Handler_Player_0 if *IX+01 is equal to 0B.
EC14 JR Z,Handler_Player_0
EC16 CP $06 Jump to Handler_Player_1 if *IX+01 is not equal to 06.
EC18 JR NZ,Handler_Player_1
Handler_Player_0 EC1A LD C,(IX+$00) C=*IX+00.
EC1D LD B,(IX+$01) B=*IX+01.
EC20 DEC B Decrease B by three.
EC21 DEC B
EC22 DEC B
EC23 CALL $0DD9 Call CL_SET.
EC26 LD HL,($5C84) HL=*DF_CC.
EC29 LD A,($F32C) A=*F32C.
EC2C AND (HL) Merge the bits from *HL.
EC2D JR NZ,Handler_Player_2 Jump to Handler_Player_2 if the result is not zero.
EC2F INC HL Increment HL by one.
EC30 LD A,($F32D) A=*F32D.
EC33 AND (HL) Merge the bits from *HL.
EC34 JR NZ,Handler_Player_2 Jump to Handler_Player_2 if the result is not zero.
EC36 INC HL Increment HL by one.
EC37 LD A,($F32E) A=*F32E.
EC3A AND (HL) Merge the bits from *HL.
EC3B JR NZ,Handler_Player_2 Jump to Handler_Player_2 if the result is not zero.
Handler_Player_1 EC3D DEC (IX+$05) Decrease *IX+05 by one.
EC40 LD A,($F33A) Increment *F33A by one.
EC43 INC A
EC44 LD ($F33A),A
EC47 JR Handler_Player_3 Jump to Handler_Player_3.
Handler_Player_2 EC49 LD A,($F33F) A=*F33F.
EC4C LD ($FFFC),A Write A to *FFFC.
EC4F CP $00 Jump to LoseLife if A is not equal to 00.
EC51 JP NZ,LoseLife
EC54 LD A,$00 Write 00 to *F33A.
EC56 LD ($F33A),A
Handler_Player_3 EC59 CALL $EEA6 Call EEA6.
EC5C LD A,C Jump to Handler_Player_8 if C is equal to 22.
EC5D CP $22
EC5F JP Z,Handler_Player_8
EC62 CP $03 Jump to Handler_Player_8 if C is equal to 03.
EC64 JP Z,Handler_Player_8
EC67 LD A,B Jump to Handler_Player_8 if B is equal to 18.
EC68 CP $18
EC6A JP Z,Handler_Player_8
EC6D CP $04 Jump to LoseLife if B is equal to 04.
EC6F JP Z,LoseLife
EC72 LD A,C Jump to Handler_Player_4 if C is not equal to *IX+00.
EC73 CP (IX+$00)
EC76 JR NZ,Handler_Player_4
EC78 LD A,B Jump to Handler_Player_4 if B is not equal to *IX+01.
EC79 CP (IX+$01)
EC7C JR NZ,Handler_Player_4
EC7E LD A,(IX+$03) Jump to Handler_Player_6 if *IX+03 is equal to D.
EC81 CP D
EC82 JR Z,Handler_Player_6
Handler_Player_4 EC84 LD A,$01 Write 01 to *F32F.
EC86 LD ($F32F),A
EC89 PUSH DE Stash DE and BC on the stack.
EC8A PUSH BC
EC8B LD A,(IX+$11) Jump to Handler_Player_5 if *IX+11 is not equal to 13.
EC8E CP $13
EC90 JR NZ,Handler_Player_5
EC92 DEC C Decrease C by two.
EC93 DEC C
Handler_Player_5 EC94 CALL $F1AF Call F1AF.
EC97 POP BC Restore BC and DE from the stack.
EC98 POP DE
EC99 CP $FF Jump to Handler_Player_6 if A is equal to FF.
EC9B JR Z,Handler_Player_6
EC9D CP (IX+$10) Jump to Handler_Player_8 if A is not equal to *IX+10.
ECA0 JR NZ,Handler_Player_8
ECA2 CALL Handler_UnlockDoor Call Handler_UnlockDoor.
Handler_Player_6 ECA5 LD (IX+$00),C Write C to *IX+00.
ECA8 LD (IX+$01),B Write B to *IX+01.
ECAB LD (IX+$02),E Write E to *IX+02.
ECAE LD (IX+$03),D Write D to *IX+03.
ECB1 PUSH DE Stash DE on the stack.
ECB2 CALL $E9E2 Call E9E2.
ECB5 POP DE Restore DE from the stack.
ECB6 LD (IX+$02),E Write E to *IX+02.
ECB9 LD (IX+$03),D Write D to *IX+03.
ECBC LD A,($F33A) Call Action_Falling if *F33A is higher than 08.
ECBF CP $08
ECC1 CALL NC,Action_Falling
ECC4 LD HL,$8978 Write 8978 (Graphics_Player) to *CHARS.
ECC7 LD ($5C36),HL
ECCA CALL $EED7 Call EED7.
ECCD LD A,($A10B) Write *A10B to *F32C.
ECD0 LD ($F32C),A
ECD3 LD A,($A12B) Write *A12B to *F32D.
ECD6 LD ($F32D),A
ECD9 LD A,($A14B) Write *A14B to *F32E.
ECDC LD ($F32E),A
ECDF LD A,(IX+$00) Write *IX+00 to *IX+0D.
ECE2 LD (IX+$0D),A
ECE5 LD A,(IX+$01) Write *IX+01 to *IX+0E.
ECE8 LD (IX+$0E),A
ECEB LD A,(IX+$03) Write *IX+03 to *IX+0F.
ECEE LD (IX+$0F),A
ECF1 LD A,(IX+$02) Write *IX+02 to *IX+0B.
ECF4 LD (IX+$0B),A
ECF7 LD A,($F32F) Jump to Handler_Player_8 if *F32F is equal to 00.
ECFA CP $00
ECFC JR Z,Handler_Player_8
ECFE LD C,(IX+$00) C=*IX+00.
ED01 LD B,(IX+$01) B=*IX+01.
ED04 LD A,(IX+$11) Jump to Handler_Player_7 if *IX+11 is not equal to 13.
ED07 CP $13
ED09 JR NZ,Handler_Player_7
ED0B DEC C Decrease C by two.
ED0C DEC C
Handler_Player_7 ED0D CALL Handler_KeysAndLockedDoors Call Handler_KeysAndLockedDoors.
Handler_Player_8 ED10 LD (IX+$04),$00 Write 00 to *IX+04.
ED14 LD (IX+$05),$00 Write 00 to *IX+05.
ED18 RET Return.
Player is falling, handle the animation.
Action_Falling ED19 LD A,$01 Write 01 to *F33F.
ED1B LD ($F33F),A
ED1E LD (IX+$11),$02 Write 02 to *IX+11.
ED22 LD A,(IX+$06) Jump to SetFallingSprite if *IX+06 is lower than 9E.
ED25 CP $9E
ED27 JR C,SetFallingSprite
ED29 ADD A,$06 A+=06.
ED2B CP $B0 Jump to SetPlayerSprite if A is not equal to B0.
ED2D JR NZ,SetPlayerSprite
SetFallingSprite ED2F LD A,$9E Set A to 9E, the first frame of the "falling" animation.
SetPlayerSprite ED31 LD (IX+$06),A Write A to *IX+06 (*PlayerSpriteID).
ED34 RET Return.
Prev: EB8D Up: Map Next: ED35