Prev: EC43 Up: Map Next: ECD8
EC45: Handle the book baddies in the library.
Used by the routine at Update_Room00.
Input
Output
Crash helmet stops Wally from being hit.
Handler_Books EC45 LD A,(Flag_BaddyInit)
EC48 OR A
EC49 JR NZ,Handler_Books_0
EC4B LD A,$01
EC4D LD (Flag_BaddyInit),A
EC50 LD A,$58
EC52 LD (Book1_Ypos),A
Book2_Ypos EC55 LD H,A
EC56 LD A,$7A
EC58 LD L,$70
EC5A LD (BitmapX),HL
EC5D CALL Bitmap16Draw
EC60 LD A,$77
EC62 LD ($EC44),A
EC65 LD H,A
EC66 LD A,$C7
EC68 LD (BitmapX),HL
EC6B CALL Bitmap16Draw
EC6E RET
Handler_Books_0 EC6F LD A,(Book1_Ypos)
EC72 LD B,A
EC73 LD H,A
EC74 LD L,$70
EC76 LD (BitmapX),HL
EC79 LD A,$7A
EC7B CALL Bitmap16Draw
EC7E INC B
EC7F LD A,B
EC80 CP $80
EC82 JR C,Handler_Books_1
EC84 LD A,$46
Handler_Books_1 EC86 LD (Book1_Ypos),A
EC89 LD (BitmapY),A
EC8C LD A,$7A
EC8E CALL Bitmap16Draw
EC91 LD A,(Pocket1)
EC94 CP $0F
EC96 JR Z,Handler_Books_2
EC98 LD A,(Pocket2)
EC9B CP $0F
EC9D JR Z,Handler_Books_2
EC9F LD B,$10
ECA1 CALL Wally_HitTest
Handler_Books_2 ECA4 LD A,($EC44)
ECA7 LD B,A
ECA8 LD H,A
ECA9 LD L,$70
ECAB LD (BitmapX),HL
ECAE LD A,$C7
ECB0 CALL Bitmap16Draw
ECB3 INC B
ECB4 LD A,B
ECB5 CP $80
ECB7 JR C,Handler_Books_3
ECB9 LD A,$46
Handler_Books_3 ECBB LD ($EC44),A
ECBE LD (BitmapY),A
ECC1 LD A,$C7
ECC3 CALL Bitmap16Draw
ECC6 LD A,(Pocket1)
ECC9 CP $0F
ECCB RET Z
ECCC LD A,(Pocket2)
ECCF CP $0F
ECD1 RET Z
ECD2 LD B,$10
ECD4 CALL Wally_HitTest
ECD7 RET
Prev: EC43 Up: Map Next: ECD8