A86: Re: FindPixel Routine
[Prev][Next][Index][Thread]
A86: Re: FindPixel Routine
>The Pebble Chop Pebble Pebble Pebble Chop Chop Fast Find Pixel Routine:
>
>I thought of this routine on the bus, can some1 please check it for
accuracy +
>speed?
It only takes a few moments to check it out yourself... BTW, Where is the
part where Y is multiplied by 16?
>rr a does this, right?:
>%11110010
>%01111001
>%00111100
>%00011110
>
>and rrc does this, right?:
>%11110010
>%01111001
>%10111100
>%01011110
>
>If i'm wrong on those two then swap them around in my routine, k? i
couldn't
>find very good help.
>
>d=X
>e=Y
>hl=byte
>a=bitmask
>
>
>FindPixel:
>rr d
>rr d
>rr d
>ld h,d
>ld a,e
>and 1
>rrca
>add a,h
>ld h,a
>
>rr e
>ld a,e
>add a,$FC
>ld l,a
>
>ld a,128
>ld c,a
>ld a,d
>and 7
>RLoop:
>cp 0
>jr z,RLoopEnd
>rr c
>dec a
>fr RLoop
>RLoopEnd:
>ld a,c
>ret