Prev: 9995 Up: Map Next: 99C9
99AF: Get Graphic Attribute Details
This is the same as GetGraphicDetails but for the attributes of a graphic, from the table at GraphicsAttributesTable, and the position gives the address in the attribute buffer (see AttributeAddress).
Input
C The graphic ID
DE The position (E is the X position and D is the Y position)
Output
B The width of the graphic
C The height of the graphic
DE The address of the first attribute of the graphic after the size
HL The attribute buffer address of the position
GetGraphicAttributeDetails 99AF LD HL,$A64E Point HL at the graphics attributes table at GraphicsAttributesTable.
99B2 DEC C Decrease the graphic ID by one.
99B3 LD B,$00 Clear the high byte of the graphic ID.
99B5 SLA C Shift C left.
99B7 RL B Rotate B left (so BC=BC * 02).
99B9 ADD HL,BC Find the entry for the graphic in the table.
99BA LD A,(HL) Fetch the low byte of the address of the attributes.
99BB INC HL Move HL on to the high byte.
99BC LD H,(HL) Fetch the high byte of the address of the attributes.
99BD LD L,A Keep the low byte of the address of the attributes in L.
99BE EX DE,HL Switch DE and HL.
99BF CALL AttributeAddress Call AttributeAddress to get the attribute buffer address of the position.
99C2 LD A,(DE) Fetch the width.
99C3 LD B,A Keep the width in B.
99C4 INC DE Move DE on to the next byte.
99C5 LD A,(DE) Fetch the height.
99C6 LD C,A Keep the height in C.
99C7 INC DE Move DE on to the next byte.
99C8 RET Return.
Prev: 9995 Up: Map Next: 99C9