Prev: 39317 Up: Map Next: 39369
39343: 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 39343 LD HL,42574 Point HL at the graphics attributes table at GraphicsAttributesTable.
39346 DEC C Decrease the graphic ID by one.
39347 LD B,0 Clear the high byte of the graphic ID.
39349 SLA C Shift C left.
39351 RL B Rotate B left (so BC=BC * 2).
39353 ADD HL,BC Find the entry for the graphic in the table.
39354 LD A,(HL) Fetch the low byte of the address of the attributes.
39355 INC HL Move HL on to the high byte.
39356 LD H,(HL) Fetch the high byte of the address of the attributes.
39357 LD L,A Keep the low byte of the address of the attributes in L.
39358 EX DE,HL Switch DE and HL.
39359 CALL AttributeAddress Call AttributeAddress to get the attribute buffer address of the position.
39362 LD A,(DE) Fetch the width.
39363 LD B,A Keep the width in B.
39364 INC DE Move DE on to the next byte.
39365 LD A,(DE) Fetch the height.
39366 LD C,A Keep the height in C.
39367 INC DE Move DE on to the next byte.
39368 RET Return.
Prev: 39317 Up: Map Next: 39369