Prev: 8B7A Up: Map Next: 8C35
8B8A: Draw Chicken
DrawChicken 8B8A LD A,($5E28) A=PlayerEnergy.
8B8D SRL A
8B8F SRL A
8B91 SRL A
8B93 LD C,A
8B94 LD A,($5E29) A=ChickenLevel.
8B97 SRL A
8B99 SRL A
8B9B SRL A
8B9D LD B,A
8B9E CP C
8B9F RET Z
8BA0 LD A,($C543)
8BA3 LD E,A
8BA4 LD A,($C48D)
8BA7 LD D,A
8BA8 PUSH IX
8BAA LD IX,$8C2D IX=Entity_Chicken.
8BAE PUSH DE
8BAF JR C,DrawChicken_3
8BB1 LD A,($C48C)
8BB4 LD E,A
8BB5 LD D,$00
8BB7 LD A,C
8BB8 PUSH BC
8BB9 CALL SetKeyPositions_22
8BBC POP BC
8BBD LD DE,($A626)
8BC1 PUSH DE
8BC2 ADD HL,DE
8BC3 LD ($A626),HL
8BC6 LD E,(HL)
8BC7 INC HL
8BC8 LD D,(HL)
8BC9 LD A,($C48D)
8BCC SUB C
8BCD JR Z,DrawChicken_1
8BCF PUSH DE
8BD0 LD (HL),A
8BD1 LD A,($C48C)
8BD4 DEC HL
8BD5 LD (HL),A
8BD6 PUSH HL
8BD7 LD A,$14
8BD9 LD (IX+$00),A
8BDC LD HL,$77C8
8BDF LD A,H
8BE0 SUB C
8BE1 LD H,A
8BE2 LD ($8C30),HL
8BE5 CALL HandlerRoomItem_0
8BE8 LD HL,($8C30)
8BEB CALL ScreenAddress
8BEE LD A,($C48C)
8BF1 LD B,A
DrawChicken_0 8BF2 LD (HL),$00
8BF4 INC L
8BF5 DJNZ DrawChicken_0
8BF7 POP HL
8BF8 POP DE
8BF9 LD (HL),E
8BFA INC HL
8BFB LD (HL),D
DrawChicken_1 8BFC POP HL
8BFD LD ($A626),HL
DrawChicken_2 8C00 POP DE
8C01 LD A,E
8C02 LD ($C543),A
8C05 LD A,D
8C06 LD ($C48D),A
8C09 POP IX
8C0B LD A,($5E28)
8C0E LD ($5E29),A
8C11 RET Return.
DrawChicken_3 8C12 LD A,C Write C to C543.
8C13 LD ($C543),A
8C16 LD A,$13 Write 13 to IX+00.
8C18 LD (IX+$00),A
8C1B LD HL,$77C8 Write 77C8 to 8C30.
8C1E LD ($8C30),HL
8C21 CALL HandlerRoomItem_0 Call HandlerRoomItem_0.
8C24 LD B,$06 B=06 (counter).
DrawChicken_4 8C26 LD (HL),$00 Write 00 to HL.
8C28 INC L Increment L by one.
8C29 DJNZ DrawChicken_4 Decrease counter by one and loop back to DrawChicken_4 until counter is zero.
8C2B JR DrawChicken_2 Jump to DrawChicken_2.
Chicken Entity
Entity_Chicken 8C2D DEFB $00,$00,$00,$00,$00,$00,$00,$00
Prev: 8B7A Up: Map Next: 8C35