Prev: EA9C Up: Map Next: EC8A
EAF6: Routine at EAF6
EAF6 CALL Controls Call Controls.
EAF9 CP $08 Jump to EB2F if A is not equal to 08.
EAFB JP NZ,$EB2F
EAFE LD A,($D244) Jump to EB2F if *JumpTable_Pointer is equal to 1C.
EB01 CP $1C
EB03 JP Z,$EB2F
EB06 LD A,($D24E) Jump to EB2F if *Active_MonsterYPosition is higher than 11.
EB09 CP $11
EB0B JR NC,$EB2F
EB0D LD A,($D24D) Jump to EB18 if *Active_MonsterXPosition is equal to FF.
EB10 CP $FF
EB12 JR Z,$EB18
EB14 CP $1D Jump to EB2F if *Active_MonsterXPosition is higher than 1D.
EB16 JR NC,$EB2F
EB18 LD HL,$D247 HL=Flag_Orientation.
EB1B LD A,(HL) A=*HL.
EB1C XOR %00000001 Flip bit 0.
EB1E INC HL Increment HL by one.
EB1F AND (HL) Merge the bits from *HL.
EB20 CALL NZ,Handler_DecreaseMonsterXPosition Call Handler_DecreaseMonsterXPosition not zero.
EB23 LD A,($D246) A=*Flag_MonsterClimbing.
EB26 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
EB27 CALL C,Handler_IncrementMonsterYPosition Call Handler_IncrementMonsterYPosition if the carry flag is set.
EB2A LD A,$08 A=08.
EB2C JP Controls_Up Jump to Controls_Up.
This entry point is used by the routine at Handler_Controls.
EB2F LD A,($D246) A=*Flag_MonsterClimbing.
EB32 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
EB33 JR NC,$EB43 Jump to EB43 if the carry flag is not set.
EB35 LD HL,$C896 HL=C896.
EB38 LD A,($D247) A=*Flag_Orientation.
Moves the orientation flag into the carry flag.
EB3B RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
EB3C JR NC,$EB4F Jump to EB4F if the carry flag is not set.
EB3E LD HL,$C8A9 HL=C8A9.
EB41 JR $EB4F Jump to EB4F.
EB43 LD HL,$C86E HL=C86E.
EB46 LD A,($D247) A=*Flag_Orientation.
Moves the orientation flag into the carry flag.
EB49 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
EB4A JR NC,$EB4F Jump to EB4F if the carry flag is not set.
EB4C LD HL,$C882 HL=C882.
EB4F LD BC,($D24D) BC=*Active_MonsterXPosition/Active_MonsterYPosition.
EB53 LD A,($D24C) Increment *D24C by one.
EB56 INC A
EB57 LD ($D24C),A
This entry point is used by the routine at Handler_Projectiles.
EB5A LD D,$00 D=00.
EB5C LD E,A E=A.
EB5D ADD HL,DE HL+=DE.
EB5E LD ($D21E),HL Write HL to *D21E.
EB61 LD D,(HL) D=*HL.
EB62 BIT 5,D Jump to EB67 if bit 5 of D is not set.
EB64 JR Z,$EB67
EB66 INC C Increment C by one.
EB67 BIT 0,D Jump to EB6C if bit 0 of D is not set.
EB69 JR Z,$EB6C
EB6B INC C Increment C by one.
EB6C BIT 1,D Jump to EB71 if bit 1 of D is not set.
EB6E JR Z,$EB71
EB70 DEC C Decrease C by one.
EB71 LD A,($D3FF) Jump to EB88 if *D3FF is not zero.
EB74 AND A
EB75 JR NZ,$EB88
EB77 LD A,($D247) A=*Flag_Orientation.
EB7A XOR %00011111 Flip bits 0-4.
EB7C CP C Jump to EC6E if A is equal to C.
EB7D JP Z,$EC6E
EB80 XOR %00011110 Flip bits 1-4.
EB82 ADD A,$FC A+=FC.
EB84 CP C Jump to EC6E if A is equal to C.
EB85 JP Z,$EC6E
EB88 BIT 2,D Jump to EB8D if bit 2 of D is not set.
EB8A JR Z,$EB8D
EB8C DEC B Decrease B by one.
EB8D LD A,D A=D.
EB8E EX AF,AF' Exchange the AF register with the shadow AF register.
EB8F BIT 3,D Jump to EBDD if bit 3 of D is not set.
EB91 JR Z,$EBDD
EB93 INC B Increment B by one.
EB94 LD A,($D3FF) Jump to EBDD if *D3FF is not zero.
EB97 AND A
EB98 JR NZ,$EBDD
EB9A LD A,$12 Jump to EC52 if B is equal to 12.
EB9C CP B
EB9D JP Z,$EC52
EBA0 LD A,B Write B to *Active_MonsterYPosition.
EBA1 LD ($D24E),A
EBA4 LD ($D21C),BC Write BC to *D21C.
EBA8 LD BC,$0502 BC=0502.
EBAB LD DE,$090F DE=090F.
EBAE CALL $E0AD Call E0AD.
EBB1 LD BC,($D21C) BC=*D21C.
EBB5 JR Z,$EBDD Jump to EBDD if {} is zero.
EBB7 LD A,($D244) Jump to EBDD if *JumpTable_Pointer is equal to 1C.
EBBA CP $1C
EBBC JR Z,$EBDD
EBBE LD A,($D246) A=*Flag_MonsterClimbing.
EBC1 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
EBC2 JP NC,$EC52 Jump to EC52 if the carry flag is not set.
EBC5 LD ($D21C),BC Write BC to *D21C.
EBC9 LD B,$05 B=05.
EBCB LD A,($D247) C=*Flag_Orientation*04.
EBCE ADD A,A
EBCF ADD A,A
EBD0 LD C,A
EBD1 LD DE,$090F DE=090F.
EBD4 CALL $E0AD Call E0AD.
EBD7 LD BC,($D21C) BC=*D21C.
EBDB JR NZ,$EC52 Jump to EC52 if {} is not zero.
EBDD LD A,($D3FF) Return if *D3FF is not zero.
EBE0 AND A
EBE1 RET NZ
EBE2 EX AF,AF' Exchange the AF register with the shadow AF register.
EBE3 BIT 4,A Jump to EC30 if bit 4 of A is not set.
EBE5 JR Z,$EC30
EBE7 INC B Increment B by one.
EBE8 LD A,($D3FF) Return if *D3FF is not zero.
EBEB AND A
EBEC RET NZ
EBED LD A,$12 Jump to EC52 if B is not equal to 12.
EBEF CP B
EBF0 JR Z,$EC52
EBF2 LD A,B A=B.
EBF3 LD ($D24E),A Write A to *Active_MonsterYPosition.
EBF6 LD ($D21C),BC Write BC to *D21C.
EBFA LD BC,$0502 BC=0502.
EBFD LD DE,$090F DE=090F.
EC00 CALL $E0AD Call E0AD.
EC03 LD BC,($D21C) BC=*D21C.
EC07 JP Z,$EC30 Jump to EC30 if {} is zero.
EC0A LD A,($D244) Jump to EC30 if *JumpTable_Pointer is equal to 1C.
EC0D CP $1C
EC0F JP Z,$EC30
EC12 LD A,($D246) A=*Flag_MonsterClimbing.
EC15 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
EC16 JR NC,$EC52 Jump to EC52 if the carry flag is not set.
EC18 LD ($D21C),BC Write BC to *D21C.
EC1C LD B,$05 B=05.
EC1E LD A,($D247) C=*Flag_Orientation*04.
EC21 ADD A,A
EC22 ADD A,A
EC23 LD C,A
EC24 LD DE,$090F DE=090F.
EC27 CALL $E0AD Call E0AD.
EC2A LD BC,($D21C) BC=*D21C.
EC2E JR NZ,$EC52 Jump to EC52 if {} is not zero.
EC30 LD ($D24D),BC Write BC to *Active_MonsterXPosition.
EC34 LD A,($D217) Jump to Handler_JumpPunch if *D217 is higher than 11.
EC37 CP $11
EC39 JP NC,Handler_JumpPunch
The routine at DrawMonsterSprite handles which monster to display.
EC3C LD A,$09 A=sprite ID 09.
George Lizzy Ralph
ID Sprite ID Sprite ID Sprite
09 sprite-9-left 49 sprite-73-left 89 sprite-137-left
EC3E PUSH BC Stash the co-ordinates on the stack.
EC3F CALL DrawMonsterSprite Call DrawMonsterSprite.
EC42 POP BC Restore the co-ordinates from the stack.
EC43 INC B Increment both the X and Y positions by one to target drawing the mouth section.
EC44 INC C
EC45 LD A,($D247) A=*Flag_Orientation.
EC48 XOR %00000001 Flip bit 0.
EC4A ADD A,C A+=C.
EC4B LD C,A C=A.
The routine at DrawMonsterSprite handles which monster to display.
EC4C LD A,$17 A=sprite ID 17.
George Lizzy Ralph
ID Sprite ID Sprite ID Sprite
17 sprite-23-left 57 sprite-87-left 97 sprite-151-left
EC4E CALL DrawMonsterSprite Call DrawMonsterSprite.
EC51 RET Return.
EC52 LD ($D24D),BC Write BC to *Active_MonsterXPosition.
EC56 LD A,($D247) A=*Flag_Orientation.
Moves the orientation flag into the carry flag.
EC59 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
EC5A CALL NC,Handler_DecreaseMonsterXPosition Call Handler_DecreaseMonsterXPosition if the carry flag is not set.
EC5D XOR A Write 00 to:
EC5E LD ($D24C),A
EC61 LD ($D246),A
EC64 LD ($D248),A
EC67 INC A Increment A by one.
EC68 LD ($D24F),A Write A to *D24F.
EC6B JP $EF86 Jump to EF86.
EC6E XOR A Write 00 to *D24C.
EC6F LD ($D24C),A
EC72 INC A Increment A by one.
EC73 LD ($D244),A Write A to *JumpTable_Pointer.
EC76 LD A,($D24E) Jump to EF86 if *Active_MonsterYPosition is equal to 12.
EC79 CP $12
EC7B JP Z,$EF86
EC7E LD A,$0B Write 0B to *JumpTable_Pointer.
EC80 LD ($D244),A
EC83 LD A,B Write B to *Active_MonsterYPosition.
EC84 LD ($D24E),A
EC87 JP Action_JumpTable Jump to Action_JumpTable.
Prev: EA9C Up: Map Next: EC8A