Prev: 7149 Up: Map Next: 7168
7155: Fetch Sprite
Used by the routine at PrepareOldSprite.
Finds the sprite for the sprite ID in the actor buffer (Actor_SpriteID), or when entering at GetSprite the sprite for the sprite ID in A. The sprite data starts with the height in lines. Each line is two bytes.
Output
DE Sprite
FetchSprite 7155 LD A,($5E22) Fetch the sprite ID from the actor buffer (Actor_SpriteID).
This entry point is used by the routine at FetchActorSprite.
GetSprite 7158 DEC A Work out the offset into the table of sprites.
7159 SLA A
715B AND %01111110 Keep only bits 1-6.
715D LD HL,$7F06 HL=SpritesTable.
7160 LD C,A Create an offset in BC.
7161 LD B,$00
7163 ADD HL,BC HL=SpritesTable + offset.
7164 LD E,(HL) DE=fetch sprite address pointed to by HL.
7165 INC HL
7166 LD D,(HL)
7167 RET Return.
View the equivalent code in;
Prev: 7149 Up: Map Next: 7168