![]() |
Routines |
| Prev: EAF6 | Up: Map | Next: ECE0 |
|
|
||||||||||||||||||||
| EC8A | LD A,($D24E) | Jump to ECC0 if *Active_MonsterYPosition is equal to 12. | ||||||||||||||||||
| EC8D | CP $12 | |||||||||||||||||||
| EC8F | JR Z,$ECC0 | |||||||||||||||||||
| EC91 | LD A,($D24B) | Decrease *Active_MonsterActionCountdown by one. | ||||||||||||||||||
| EC94 | DEC A | |||||||||||||||||||
| EC95 | LD ($D24B),A | |||||||||||||||||||
| EC98 | CP $12 | Jump to ECA3 if *Active_MonsterActionCountdown is higher than 12. | ||||||||||||||||||
| EC9A | JR NC,$ECA3 | |||||||||||||||||||
| EC9C | CALL Handler_IncrementMonsterYPosition | Call Handler_IncrementMonsterYPosition. | ||||||||||||||||||
| EC9F | CP $12 | Jump to ECC0 if A is equal to 12. | ||||||||||||||||||
| ECA1 | JR Z,$ECC0 | |||||||||||||||||||
|
The routine at DrawMonsterSprite handles which monster to display.
|
||||||||||||||||||||
| ECA3 | LD A,$09 | A=sprite ID 09.
|
||||||||||||||||||
|
Set the co-ordinates for where to draw.
|
||||||||||||||||||||
| ECA5 | LD BC,($D24D) | BC=*Active_MonsterXPosition/Active_MonsterYPosition. | ||||||||||||||||||
| ECA9 | PUSH BC | Stash the co-ordinates on the stack. | ||||||||||||||||||
| ECAA | CALL DrawMonsterSprite | Call DrawMonsterSprite. | ||||||||||||||||||
| ECAD | POP BC | Restore the co-ordinates from the stack. | ||||||||||||||||||
| ECAE | INC B | Increment both the X and Y positions by one to target drawing the mouth section. | ||||||||||||||||||
| ECAF | INC C | |||||||||||||||||||
| ECB0 | LD A,($D247) | A=*Flag_Orientation. | ||||||||||||||||||
| ECB3 | XOR %00000001 | Flip bit 0. | ||||||||||||||||||
| ECB5 | ADD A,C | A+=C. | ||||||||||||||||||
| ECB6 | LD C,A | C=A. | ||||||||||||||||||
|
The routine at DrawMonsterSprite handles which monster to display.
|
||||||||||||||||||||
| ECB7 | LD A,$17 | A=sprite ID 17.
|
||||||||||||||||||
| ECB9 | CALL DrawMonsterSprite | Call DrawMonsterSprite. | ||||||||||||||||||
| ECBC | CALL Handler_IncrementMonsterYPosition | Call Handler_IncrementMonsterYPosition. | ||||||||||||||||||
| ECBF | RET | Return. | ||||||||||||||||||
| ECC0 | LD A,($D247) | A=*Flag_Orientation. | ||||||||||||||||||
|
Moves the orientation flag into the carry flag.
|
||||||||||||||||||||
| ECC3 | RRCA | Rotate A right one position, setting the carry flag if bit 0 was set. | ||||||||||||||||||
| ECC4 | CALL NC,Handler_DecreaseMonsterXPosition | Call Handler_DecreaseMonsterXPosition if the carry flag is not set. | ||||||||||||||||||
| ECC7 | LD A,$12 | Write 12 to *Active_MonsterYPosition. | ||||||||||||||||||
| ECC9 | LD ($D24E),A | |||||||||||||||||||
| ECCC | LD A,$19 | Write 19 to *Active_MonsterActionCountdown. | ||||||||||||||||||
| ECCE | LD ($D24B),A | |||||||||||||||||||
| ECD1 | XOR A | Write 00 to: | ||||||||||||||||||
| ECD2 | LD ($D246),A | |||||||||||||||||||
| ECD5 | LD ($D248),A | |||||||||||||||||||
| ECD8 | LD A,$01 | Write 01 to *D24F. | ||||||||||||||||||
| ECDA | LD ($D24F),A | |||||||||||||||||||
| ECDD | JP $EF86 | Jump to EF86. | ||||||||||||||||||
| Prev: EAF6 | Up: Map | Next: ECE0 |