Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!labrea!polya!rokicki From: rokicki@polya.Stanford.EDU (Tomas G. Rokicki) Newsgroups: comp.sys.amiga.tech Subject: Re: Blitter shifting Message-ID: <3645@polya.Stanford.EDU> Date: 17 Aug 88 22:25:35 GMT References: <3985@umd5.umd.edu> Organization: Stanford University Lines: 44 In article <3985@umd5.umd.edu>, brett@pigpen (Brett S Bourbin) writes: > I am trying to use the Blitter to shift one of my sources before it is moved > into the destination bitplane. I read the "Lost Blitter Docs" and they said > you would have to: > > 1) Move one more word than is in your image (extra word needed for > the shift) > 2) Subtract one from each of the modulo registers > 3) use acending mode for bit shifts to the right > > now, i have an image that is two words long (16 bits) and i want to shift > it one bit to the right, before i store it in the destination plane, which > has 36 bytes per row. i set the a source modulo to -2, since it is a packed > image, and the c source and d dest modulo registers to "36-4-2". the docs > say that you must subtract one from the calculated modulo values, but > shouldn't that be two, since the modulos are byte counts to add to the source > addresses? simply use the afwm and alwm in conjunction with the a data register to mask, and use the b channel to actually fetch the data. channel enabled address mod shift data a n --- --- 1 $ffff b y source -2 1 --- c y dest 30 --- d y dest 30 width = 2 afwm = $ffff alwm = 0 function = (ac + ~ab) note that it would also work if the shift for the a channel was 0, and you initialized the afwm to $efff and the alwm to $1000. this is often useful. for shifts the other direction, it is usually easiest to use descending mode. pick up a copy of blitlab; mail me your address and i'll send you a copy along with the associated documentation to answer these and related questions . . . i've never seen the `lost blitter docs'; i'd be interested in what they contain . . . -tom