|  | Routines | 
| Prev: 60150 | Up: Map | Next: 60640 | 
|  | ||||||||||||||||||||
| 60554 | LD A,(53838) | Jump to 60608 if *Active_MonsterYPosition is equal to 18. | ||||||||||||||||||
| 60557 | CP 18 | |||||||||||||||||||
| 60559 | JR Z,60608 | |||||||||||||||||||
| 60561 | LD A,(53835) | Decrease *Active_MonsterActionCountdown by one. | ||||||||||||||||||
| 60564 | DEC A | |||||||||||||||||||
| 60565 | LD (53835),A | |||||||||||||||||||
| 60568 | CP 18 | Jump to 60579 if *Active_MonsterActionCountdown is higher than 18. | ||||||||||||||||||
| 60570 | JR NC,60579 | |||||||||||||||||||
| 60572 | CALL Handler_IncrementMonsterYPosition | Call Handler_IncrementMonsterYPosition. | ||||||||||||||||||
| 60575 | CP 18 | Jump to 60608 if A is equal to 18. | ||||||||||||||||||
| 60577 | JR Z,60608 | |||||||||||||||||||
| 
The routine at DrawMonsterSprite handles which monster to display.
 | ||||||||||||||||||||
| 60579 | LD A,9 | A=sprite ID 9. 
 | ||||||||||||||||||
| 
Set the co-ordinates for where to draw.
 | ||||||||||||||||||||
| 60581 | LD BC,(53837) | BC=*Active_MonsterXPosition/Active_MonsterYPosition. | ||||||||||||||||||
| 60585 | PUSH BC | Stash the co-ordinates on the stack. | ||||||||||||||||||
| 60586 | CALL DrawMonsterSprite | Call DrawMonsterSprite. | ||||||||||||||||||
| 60589 | POP BC | Restore the co-ordinates from the stack. | ||||||||||||||||||
| 60590 | INC B | Increment both the X and Y positions by one to target drawing the mouth section. | ||||||||||||||||||
| 60591 | INC C | |||||||||||||||||||
| 60592 | LD A,(53831) | A=*Flag_Orientation. | ||||||||||||||||||
| 60595 | XOR %00000001 | Flip bit 0. | ||||||||||||||||||
| 60597 | ADD A,C | A+=C. | ||||||||||||||||||
| 60598 | LD C,A | C=A. | ||||||||||||||||||
| 
The routine at DrawMonsterSprite handles which monster to display.
 | ||||||||||||||||||||
| 60599 | LD A,23 | A=sprite ID 23. 
 | ||||||||||||||||||
| 60601 | CALL DrawMonsterSprite | Call DrawMonsterSprite. | ||||||||||||||||||
| 60604 | CALL Handler_IncrementMonsterYPosition | Call Handler_IncrementMonsterYPosition. | ||||||||||||||||||
| 60607 | RET | Return. | ||||||||||||||||||
| 60608 | LD A,(53831) | A=*Flag_Orientation. | ||||||||||||||||||
| 
Moves the orientation flag into the carry flag.
 | ||||||||||||||||||||
| 60611 | RRCA | Rotate A right one position, setting the carry flag if bit 0 was set. | ||||||||||||||||||
| 60612 | CALL NC,Handler_DecreaseMonsterXPosition | Call Handler_DecreaseMonsterXPosition if the carry flag is not set. | ||||||||||||||||||
| 60615 | LD A,18 | Write 18 to *Active_MonsterYPosition. | ||||||||||||||||||
| 60617 | LD (53838),A | |||||||||||||||||||
| 60620 | LD A,25 | Write 25 to *Active_MonsterActionCountdown. | ||||||||||||||||||
| 60622 | LD (53835),A | |||||||||||||||||||
| 60625 | XOR A | Write 0 to: | ||||||||||||||||||
| 60626 | LD (53830),A | |||||||||||||||||||
| 60629 | LD (53832),A | |||||||||||||||||||
| 60632 | LD A,1 | Write 1 to *53839. | ||||||||||||||||||
| 60634 | LD (53839),A | |||||||||||||||||||
| 60637 | JP 61318 | Jump to 61318. | ||||||||||||||||||
| Prev: 60150 | Up: Map | Next: 60640 |