Article View: comp.sys.amiga.tech
Article #9070Re: Blitter problem (still there)
From: Dale Luck
Date: Sat, 11 Jun 1988 04:43
Date: Sat, 11 Jun 1988 04:43
69 lines
2680 bytes
2680 bytes
In article <8806090704.AA14228@jade.berkeley.edu> FATQW@USU.BITNET (Bryan Ford) writes:
> OwnBlitter();
>
> for(i = 0;i < Depth;i++) {
> WaitBlit();
> custom.bltapt = (APTR)BitMap->Planes[i];
> custom.bltdpt = (APTR)Plane;
> custom.bltafwm = custom.bltalwm = 0xffff;
Not a good idea to use these kind of statements when talking to
amiga custom chips. The writable registers are not readable and some
compilers will generate:
move.w #0,custom.bltalwm
move.w custom.bltalwm,custom.bltafwm
You should use seperate statements for each register load.
> custom.bltamod = custom.bltbmod = custom.bltdmod = custom.bltcon1 = 0;
Again not a good idea.
See previous statement
> if (i != 0) {
> custom.bltbpt = (APTR)Plane;
> custom.bltcon0 = BC0F_SRCA | BC0F_SRCB | BC0F_DEST |
> (Color & 1 ? ABC | ABNC : NABC | NABNC);
> } else {
> custom.bltcon0 = BC0F_SRCA | BC0F_DEST |
> (Color & 1 ? ABC | ABNC | ANBC | ANBNC :
> NABC | NABNC | NANBC | NANBNC);
> }
> custom.bltsize = (Height << 6) | (Width >> 4);
If your width is 1024, this will cause a 1 to be ored into
the rows count, you should use (0x3f & (Width>>4))
> Color >>= 1;
> }
>
> WaitBlit();
This statement is not necessary as long as you do a WaitBlit before
using the data. This will give you a little more parallelism.
> DisownBlitter();
Good boy
> return(Plane);
>}
I haven't actually looked at you algorithm for lagic problems like
bad choice of minterms. I will tell you though that the flood fill
routine in the graphics library does something similar but it does it
a little more optimally. But takes more work to figure it out.
Basically if you have 3 or fewer bitplanes it only takes 1 blit.
If you have 4-5 bitplanes it takes 2 blits
If you have 6-7 bitplanes it takes 3 blits.
......
--
Dale Luck Boing, Inc.
Although I do contract work for Amiga-LosGatos, my opinions probably
don't represent those of Commodore or its management or it's engineers,
but I think the world would be a better place if they did.
Technical Details
Message-ID:
<323@boing.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!oliveb!amiga!boing!daleReferences:
<8806090704.AA14228@jade.berkeley.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!oliveb!amiga!boing!dale From: dale@boing.UUCP (Dale Luck) Newsgroups: comp.sys.amiga.tech Subject: Re: Blitter problem (still there) Message-ID: <323@boing.UUCP> Date: 11 Jun 88 04:43:06 GMT References: <8806090704.AA14228@jade.berkeley.edu> Reply-To: dale@boing.UUCP (Dale Luck) Organization: Boing, Milpitas, Ca. Lines: 69