Prev: 9995 Up: Map Next: 99C9
99AF: Look up a sprite's colours
The same routine as FETCH_SPRITE but based at FURNITURE_COLOURS -- the 200th entry of SPRITE_TABLE rather than the 161st -- and ending in PIXEL_TO_ATTR rather than PIXEL_TO_SCREEN, so what it fetches is a sprite's colours rather than its shape.
Input
C Sprite number
FETCH_SPRITE_ATTRS 99AF LD HL,FURNITURE_COLOURS The colour tables, one per sprite.
99B2 DEC C
99B3 LD B,$00
99B5 SLA C
99B7 RL B
99B9 ADD HL,BC
99BA LD A,(HL)
99BB INC HL
99BC LD H,(HL)
99BD LD L,A
99BE EX DE,HL
99BF CALL PIXEL_TO_ATTR The attribute address rather than the display one.
99C2 LD A,(DE)
99C3 LD B,A
99C4 INC DE
99C5 LD A,(DE)
99C6 LD C,A
99C7 INC DE
99C8 RET
Prev: 9995 Up: Map Next: 99C9