Prev: 9E86 Up: Map Next: 9E96
9E89: Get Sprite Address
Used by the routines at HandlerFoodItem, HandlerKnight and GetEntitySprite.
Input
A The Sprite ID
Output
DE The sprite address
GetSpriteAddress 9E89 DEC A Decrease A by one.
9E8A LD L,A Create an offset in HL.
9E8B LD H,$00
9E8D ADD HL,HL HL=HL * 2.
9E8E LD BC,$A4BE HL=SpritesTable + offset.
9E91 ADD HL,BC
9E92 LD E,(HL) DE=the sprite address.
9E93 INC HL
9E94 LD D,(HL)
9E95 RET Return.
View the equivalent code in;
Prev: 9E86 Up: Map Next: 9E96