Prev: 29980 Up: Map Next: 30056
30018: Actor: Get Position/ Direction
Used by the routine at 29861.
ActorFindPosDir 30018 LD A,(24075) A=actor X position.
30021 AND %00000110 Keep only bits 1-2.
30023 LD C,A Store the result in C.
30024 LD A,(24077) A=actor movement direction.
Actor: Get Sprite Address
ActorGetSpriteAddress 30027 BIT 6,A Jump to ActorFindPosDir_0 if bit 6 of sprite header is reset.
30029 JR Z,ActorFindPosDir_0
30031 SET 3,C
ActorFindPosDir_0 30033 DEC A
30034 CP 3
30036 JR NC,30056
30038 RLCA
30039 RLCA
30040 RLCA
30041 RLCA
30042 AND %11110000 Keep only bits 4-7.
30044 OR C
30045 LD HL,30234 HL=SpritesTable.
This entry point is used by the routine at 30056.
ActorFindPosDir_1 30048 LD C,A Create an offset in BC.
30049 LD B,0
30051 ADD HL,BC HL=sprite table + offset.
30052 LD E,(HL) DE=sprite address.
30053 INC HL
30054 LD D,(HL)
30055 RET Return.
Prev: 29980 Up: Map Next: 30056