;SET SPRITE COLOR (Screen 4 or higher)

;SetColorSprite nsprite,idcolordata

func_setcolorsprite:

push hl

ld hl,($cb03)

or a
jr z,setcolorsprite_2

ld b,a
ld de,16

setcolorsprite_1:

add hl,de
djnz setcolorsprite_1

setcolorsprite_2:

ld a,($cb05)

rlc h
rla
rlc h
rla
srl h
srl h
di
out ($99),a
ld a,142
out ($99),a
ld a,l
out ($99),a
ld a,h
or 64
ei
out ($99),a

pop hl

ld a,(7)
ld c,a
ld b,16

otir

ret

