Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rutgers!att!cbnewsm!nsw From: nsw@cbnewsm.ATT.COM (Neil Weinstock) Newsgroups: comp.sys.amiga.tech Subject: Blitter twiddling questions (kinda long) Message-ID: <6344@cbnewsm.ATT.COM> Date: 8 Nov 89 16:59:02 GMT Reply-To: nsw@cbnewsm.ATT.COM (Neil Weinstock) Distribution: na Organization: The Flying Squid Patrol Lines: 69 Hi, y'all. I'm playing with the blitter (directly) for the first time, and there's a few things I'm unclear on. First, how long is OK to own the blitter? I don't want to be unfriendly. Next, what is the best way to set up the blitter to either clear a bitplane or set it to all ones? If I turn off all the sources, what gets written to the destination? Finally, for source A I want the equivalent of a 1-bit shift to the left, and there will be an unshifted B and C source and destination. (Ack. I may have it confused, I'm assuming the shift direction for A and B is normally a right shift. If I'm backwards, the question probably doesn't apply, though I also want to do a right shift). It seems the way to shift "against the grain" is to specify a shift value of 15 and offset the beginning of the blit area by one. My problem arises when considering the boundary conditions. In the hideously inadequate pictures below, assume each dot is a bit, the ">" represents the start of the bitplane data for the blitter. If no shifting is done, the start of the blit looks like this: >0...............1................2... A case1: >0...............1................2... B Now, if we apply a shift of 15 to A, it looks like this: >0...............1................2... A case2: >0...............1...............2... B Now we decide to start the source A one word to the right, to correct for the offset: >1...............2................3... A case3: >0...............1...............2... B Everythings OK, but we haven't done anything useful to the first word of B. So what is the solution? Offset both A and B one word to the left: >0...............1................2... A case4: >-1...............0...............1................2... B Now, everything's great, but the destination, not shown, will have to look like B, and I will be writing into the -1'st word in a bitplane, a word that I have not allocated. No good. I could overallocate the bitplane, but it seems like there should be another way. The only thing I can think of is if I use case 3, but preload the blitter's A data register with A[0], so that A[0] gets used as the "old" value that appears in the block diagram in the hardware manual: 0.."old" data..>1...............2................3... A case3: >0...............1...............2... B Now, everything would seem to be OK, I think. Is this reasonable? Am I going about this the right way? (god, I hope this all makes some sense). Thanks for any input. ________________ __________________ ____________________________ //// \\// \\// \\\\ \\\\ Neil Weinstock //\\ att!cord!nsw or //\\ "Oh dear, now I shall have //// //// AT&T Bell Labs \\// nsw@cord.att.com \\// to create more Martians." \\\\ \\\\________________//\\__________________//\\____________________________////