Prev: BF8E Up: Map Next: BFEC
BF9F: Routine at BF9F
Used by the routine at BF50.
BF9F LD E,$42 E=42.
BFA1 LD BC,$0000 BC=0000.
BFA4 INC B Increment B by one.
BFA5 BIT 4,B Return if bit 4 of B is set.
BFA7 RET NZ
BFA8 PUSH BC Stash BC, DE and BC on the stack.
BFA9 PUSH DE
BFAA PUSH BC
BFAB LD IX,$C36E IX=C36E.
BFAF LD (IX+$12),E Write E to *IX+12.
BFB2 CALL $B416 Call B416.
BFB5 POP BC Restore BC from the stack.
BFB6 LD HL,$CC3D HL=CC3D.
BFB9 CALL $C1CD Call C1CD.
BFBC LD A,($C1E5) A=*C1E5.
BFBF AND %00011000 Keep only bits 3-4.
BFC1 OR C Set the bits from C.
BFC2 OUT ($FE),A OUT FE
BFC4 LD E,B E=B.
BFC5 SLA E Shift E left (with carry).
BFC7 SLA E Shift E left (with carry).
BFC9 LD D,$00 D=00.
BFCB PUSH DE Stash DE on the stack.
BFCC POP IX Restore IX from the stack.
BFCE LD DE,$FFFF DE=FFFF.
BFD1 ADD IX,DE IX+=DE.
BFD3 BIT 7,(HL) Jump to BFDB if bit 7 of *HL is set.
BFD5 JR NZ,$BFDB
BFD7 JR C,$BFD1 Jump to BFD1 if {} is lower.
BFD9 JR $BFB9 Jump to BFB9.
BFDB RES 7,(HL) Reset bit 7 of *HL.
BFDD POP DE Restore DE from the stack.
BFDE DJNZ $BFA9 Decrease counter by one and loop back to BFA9 until counter is zero.
BFE0 LD A,$05 A=05.
BFE2 XOR E Reset the bits from E.
BFE3 LD E,A E=A.
BFE4 POP BC Restore BC from the stack.
BFE5 LD A,$06 A=06.
BFE7 XOR C Reset the bits from C.
BFE8 LD C,A C=A.
BFE9 JR $BFA4 Jump to BFA4.
BFEB RET Return.
Prev: BF8E Up: Map Next: BFEC