Prev: FEA2 Up: Map Next: FEE7
FEC0: Get the attribute at the specified position
Used by the routine at FEA2.
Input
H Y co-ordinate
L X co-ordinate
A On return, holds the attribute
FEC0 PUSH BC Remember BC.
FEC1 LD A,L Put the top 5 bits of the X co-ordinate in C.
FEC2 AND $F8
FEC4 RRCA
FEC5 RRCA
FEC6 RRCA
FEC7 LD C,A
FEC8 LD A,H Put the top 5 bits of the Y co-ordinate in B.
FEC9 AND $F8
FECB RRCA
FECC RRCA
FECD RRCA
FECE LD B,A
FECF LD A,$18 Convert the Y co-ordinate into a screen offset.
FED1 SUB B
FED2 DEC A
FED3 LD B,A
FED4 LD L,B Multiply this by 32 to get a particular row offset on screen.
FED5 LD H,$00
FED7 ADD HL,HL
FED8 ADD HL,HL
FED9 ADD HL,HL
FEDA ADD HL,HL
FEDB ADD HL,HL
FEDC LD D,$00 Add the X co-ordinate.
FEDE LD E,C
FEDF ADD HL,DE
FEE0 LD DE,$5800 Add the base address of the attribute buffer.
FEE3 ADD HL,DE
FEE4 LD A,(HL) Put the attribute in A.
FEE5 POP BC Restore BC and return.
FEE6 RET
Prev: FEA2 Up: Map Next: FEE7