View Single Post
Old 09 October 2011, 22:52   #17
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,593
Quote:
Originally Posted by Photon
But I think you just want to make the ultimate most fantastic superfast *drumroll* ILBM converter... which I find utterly unnecessary but there you go
No, I quite agree. Under all previous circumstances I've converted graphics data to raw. Converting ILBMs on the fly is pointless - except when the specific task at hand is to convert them on the fly that is.

So my thinking was along these lines: if that's what I've gotta do, might as well do it as quick as possible cos, after all, doing things smaller and faster is where the fun comes into assembly coding.

Anyway, updated quicker versions are -

cols:

Code:
                    move.b              #$f0,d6
                    moveq.l             #32-1,d7
.put_colours:       move.b              (a0)+,d0
                    lsl.w               #4,d0
                    move.b              (a0)+,d0
                    and.b               d6,d0
                    move.b              (a0)+,d1
                    lsr.w               #4,d1
                    or.w                d1,d0
                    move.w              d0,(a1)
                    addq.w              #4,a1
                    dbf                 d7,.put_colours
RLE decode:

Code:
                    movea.l             screenone_ptr(a5),a2
                    move.w              #screen_ht-1,d5
.next_row:          moveq.l             #screen_bpls-1,d6
                    movea.l             a2,a3
.crntrow_allbpls:   moveq.l             #screen_wd,d4
.rle_decode:        moveq.l             #0,d7
                    move.b              (a0)+,d7
                    bmi.b               .replicate
                    sub.b               d7,d4
.copy:              move.b              (a0)+,(a3)+
                    dbf                 d7,.copy
                    bra.b               .next_bpl
.replicate:         neg.b               d7
                    sub.b               d7,d4
                    move.b              (a0)+,d3
.do_replicate:      move.b              d3,(a3)+
                    dbf                 d7,.do_replicate
.next_bpl:          subq.b              #1,d4
                    bne.b               .rle_decode
                    lea                 screen_bplsz-screen_wd(a3),a3
                    dbf                 d6,.crntrow_allbpls
                    lea                 screen_wd(a2),a2
                    dbf                 d5,.next_row
                    rts
Thanks for your advice guys - especially Thoram, much neater and tidier colour extraction loop and shaved about a raster line off execution time too

Last edited by pmc; 10 October 2011 at 09:11.
pmc is offline  
 


Page generated in 0.04543 seconds with 9 queries