Dave Westbury wrote:
005e01c0a3db$45515fa0$342b073e@default">
I sent a corrected piece of code using two 16 bit 64k lookup tables
as follows.

a0 points to RG table and a1 to B.

m33RGB move.w (a4)+,d2 get B0
move.w (a4)+,d3 get RG
move.w (a0,d3.w),d3 use lookup table to sort RG
move.w (a1,d2.w),d2 also sort B
or.w d2,d3 combine RGB
m33done move.w d3,d6 left pixel done, now do right
swap d6
... inline repeat of above for right pixel
move.l d6,(a3)+ two pixels to window save area

BORG in BBBBBBBBOOOOOOOO RRRRRRRRGGGGGGGG
76543210 7654321076543210
After Lookup 0000000000BBBBB0 GGGGGRRRRR00000G
76543 7654376543 2
After OR GGGGGRRRRRBBBBBG
7654376543765432

Using just G2 it would be quicker to do:

m33RGB move.l (a4)+,d3 get BORG
roxr.b #3,d3 get G7-3, G2 to eXtend flag
rol.w #5,d3 get R7-3
rol.l #5,d3 get B7-3
roxl.w #1,d3 get G2 from eXtend flag

Comparison of clocks (if I have got them correct) for 68040:

move (An)+,Dn 2 (x 2)
move d8(An,Xn),Dn 9 (x 2)
or Dn,Dn 2 (x 1) total 24

move (An)+,Dn 2 (x 1)
roxr/l #n,Dn 6 (x 2)
rol #n,Dn 4 (x 2) total 22

and it wouldn't require 128K of tables :-)

Regards,
Dave.

A very neat solution. Lookup tables are a last resort.

Cheers
Malcolm


005e01c0a3db$45515fa0$342b073e@default">





Reply via email to