Prev: DFA8 Up: Map Next: E004
DFB2: Routine at DFB2
Used by the routines at FetchTileObject and F801.
Input
A Item ID
DFB2 LD ($E2C7),A Write A to *Item_ID.
DFB5 CP $01 Return if A is lower than 01.
DFB7 RET M
DFB8 CP $15 Return if A is greater than or equal to 15.
DFBA RET P
DFBB LD A,($D837) Jump to DFD4 if *D837 is equal to 00.
DFBE CP $00
DFC0 JR Z,$DFD4
DFC2 LD HL,$DFEE HL=DFEE.
DFC5 LD B,$00 B=00.
DFC7 LD C,A C=*D837.
DFC8 ADD HL,BC HL+=BC.
DFC9 LD C,(HL) C=*HL.
DFCA LD HL,$5896 HL=5896 (attribute buffer location).
DFCD ADD HL,BC HL+=BC.
DFCE LD A,($E003) A=*E003.
DFD1 CALL $DFA8 Call DFA8.
DFD4 LD A,($E2C7) Write *Item_ID to *D837.
DFD7 LD ($D837),A
DFDA LD HL,$DFEE HL=DFEE.
DFDD LD B,$00 B=00.
DFDF LD C,A C=*Item_ID.
DFE0 ADD HL,BC HL+=BC.
DFE1 LD C,(HL) C=*HL.
DFE2 LD HL,$5896 HL=5896 (attribute buffer location).
DFE5 ADD HL,BC HL+=BC.
DFE6 LD A,(HL) Write *HL to *E003.
DFE7 LD ($E003),A
DFEA LD A,$78 A=INK: BLACK, PAPER: WHITE (BRIGHT) .
DFEC JP $DFA8 Jump to DFA8.
DFEF DEFB $00,$02,$04,$06,$08
DFF4 DEFB $40,$42,$44,$46,$48
DFF9 DEFB $80,$82,$84,$86,$88
DFFE DEFB $C0,$C2,$C4,$C6,$C8
E003 DEFB $00
Prev: DFA8 Up: Map Next: E004