Path: utzoo!mnetor!uunet!mcvax!ukc!mupsy!liv-cs!unpowell From: unpowell@csvax.liv.ac.uk Newsgroups: comp.sys.atari.st Subject: Re: More info on software color upgrade Message-ID: <548@csvax.liv.ac.uk> Date: 17 Mar 88 16:52:52 GMT References: <2508@tekig5.TEK.COM> <2137@polya.STANFORD.EDU> <2531@tekig5.TEK.COM> Lines: 84 Organisation: Computer Science CSVAX (VAX1), Liverpool University In article <2531@tekig5.TEK.COM>, wayneck@tekig5.TEK.COM (Wayne Knapp) writes: > In article <2137@polya.STANFORD.EDU>, rokicki@polya.STANFORD.EDU (Tomas G. Rokicki) writes: >> Try movem. As in: >> >> movem.l (a0)+,a2-a5/d0-d7 >> movem.l a2-a5/d0-d7,(a1) >> add.w #48,a1 >> >> Much faster than >> >> move.l (a0)+,(a1)+ >> >> repeated 12 times. >> >> -tom > > Maybe I'm confused and not counting cycles correctly, if so show me where > I going wrong. But it looks like the move multiple sequence is only 6 cycles > faster than the 12 move.1 (a0)+,(a1)+. The advantange of the move.l is that > you get a more even color change than the movem gives. That is every color > change is exactly 20 cycles apart. Here is what I believe the timings are. > > movem.l (a0)+,a2-a5/d0-d7 # 8 + 8 * 12 = 104 > movem.l a2-a5/d0-d7,(a1) #12 + 8 * 12 = 108 > add.w #48,a1 # 22 > ---- > 234 > > Where as 12 move.l (a0)+,(a1)+ gives 12 * 20 or 240 cycles. Is this correct > or am I goofed up. Thanks for your help. > > Wayne Knapp > For the purpose of moving colours into the pallette registers, surely, both of the above routines aren't much use. The pallette registers occupy 16 words starting at address $ff8240. So therefore you should be moving these "new" colours in 16 word blocks? And not 12*2=24 words as you seem to be doing. To move colours in 16 word blocks, move multiple could be the best bet, because the "move.l (a0)+,(a1)+" has the added problem of restoring a1 to point back to pallette 0. eg lea colorlist,a0 lea $8240.w,a1 movem.l (a0)+,d0-d7 * get 16 words movem.l d0-d7,(a1) * put 16 words into pallette registers ... etc ... As you can see this doesn't affect a1, and so it always points to pallette 0 ($ff8240). The equivalent with "move.l (a0)+,(a1)+" needs a1 resetting back to pallette 0 when it has gone through 16 words. lea colorlist,a0 lea $8240.w,a2 move.l a2,a1 move.l (a0)+,(a1)+ * move 16 words move.l (a0)+,(a1)+ * from "colorlist" to pallette's move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ move.l a2,a1 move.l (a0)+,(a1)+ ... etc ... Of course when a1 gets to the end of the pallette's you could then go backwards (change to "move.l (a0)+,-(a1)") for then next 16 words and then change back to "move.l (a0)+,(a1)+", and so on. This would produce a move even pallette change than the above, where there is a "gap" between pallette's 15 and 0. Mark Powell, Liverpool University, Merseyside, England. ******************************************************************************** "...there's no success JANET unpowell@uk.ac.lis.csvax like failure and UUCP {backbone}!mcvax!ukc!mupsy!lis-cs!unpowell failure's no success ARPA unpowell%csvax.lis.ac.uk@nss.cs.ucl.ac.uk at all..." B.Dylan ********************************************************************************