Prev: 8822 Up: Map Next: 8B78
8B22: Routine at 8B22
Used by the routine at 869B.
8B22 LD A,($B6F2)
8B25 AND A
8B26 RET Z
8B27 PUSH HL
8B28 PUSH DE
8B29 PUSH BC
8B2A LD D,$01
8B2C LD HL,$5020
8B2F XOR A
8B30 LD E,A
8B31 OUT ($FB),A
8B33 IN A,($FB)
8B35 ADD A,A
8B36 JP M,$8B74
8B39 JR NC,$8B33
8B3B PUSH HL
8B3C PUSH DE
8B3D LD A,D
8B3E CP $02
8B40 SBC A,A
8B41 AND E
8B42 RLCA
8B43 AND E
8B44 LD D,A
8B45 LD C,(HL)
8B46 PUSH HL
8B47 LD B,$08
8B49 LD A,D
8B4A RLC C
8B4C RRA
8B4D LD H,A
8B4E IN A,($FB)
8B50 RRA
8B51 JR NC,$8B4E
8B53 LD A,H
8B54 OUT ($FB),A
8B56 DJNZ $8B49
8B58 POP HL
8B59 INC HL
8B5A LD A,L
8B5B AND $1F
8B5D JR NZ,$8B45
8B5F IN A,($FB)
8B61 RRA
8B62 JR NC,$8B5F
8B64 LD A,D
8B65 RRCA
8B66 OUT ($FB),A
8B68 POP DE
8B69 POP HL
8B6A INC H
8B6B INC E
8B6C BIT 3,E
8B6E JR Z,$8B31
8B70 LD A,$04
8B72 OUT ($FB),A
8B74 POP BC
8B75 POP DE
8B76 POP HL
8B77 RET
Prev: 8822 Up: Map Next: 8B78