Index: [thread] [date] [subject] [author]
  From: WolfWings ShadowFlight <wolfwings@lightspeed.net>
  To  : ggi-develop@eskimo.com
  Date: Mon, 6 Jul 1998 00:16:09 -0700 (PDT)

Re: kgicon difficulties |-< (and new tarballs |->)

On Sun, 5 Jul 1998, KC5TJA wrote:

>> That's not the issue. If you use a 8 bitplanes mode (for 256 colors), when
>> you want to change the color of a pixel, you have to change one bit
>> in eight different bytes, that means eight times reading one byte, masking
>> a bit out, oring the new value, writing the byte back ; whereas when
>> using a 256 color chunky pixel mode, you just _write one byte_, and
>> there, you have changed the color. Blitter or not, it's 1 operation instead
>> of 24 (worst case) and way less memory access ; considering that
>> accessing chip memory on the amiga was slllooowww.
>
>This is true; I never thought about it in that manner before...

No, that's not true, actually. Yes, it's less effecient for 8, 16, 24, or
any multiple of 8 bitplanes than a chunky mode, but for a 6-bit mode? Or a
3-bit mode? Or even a 30-bit mode? Try thinking in terms of a single
bit-plane, a 1-bit mode. You're forgetting that a blitter can take
advantage of various strategies, such as this:

Say you're blitting from this block(@) of memory
********|********|*****@@@|@@@@@@@@|@@@@@***
to this block(#) of memory
########|########|********|********|********

Guess what, the blitter won't have to do any masking, only 4*bitplanes
reads, 2*bitplanes shifts, 2*bitplanes oring and 2*bitplanes writes,
assuming an 8-bit bus. Assume a 16-bit bus, it lowers it to 2*bitplanes
reads as well, or to be more precise, ((width+7)/8)*bitplanes reads,
shifts, ors, and writes.  Not the staggering 32*bitplanes reads,
32*bitplanes masking operations, 16*bitplanes oring, and 16*bitplanes
writes a 16-pixel blit would supposedly take. You're overestimating by a
rather large factor, forgetting to take advantage of the opportunity to
move multiple bits at a time. 

Here's an example of one bit-plane worth of operation:
Read this block(+)
********|********|*****+++|@@@@@@@@|@@@@@***
shift it from *****+++ to +++00000
Read this block($)
********|********|********|$$$$$@@@|@@@@@***
shift it from $$$$$@@@ to 000$$$$$
or it with previous to +++$$$$$
write it to the block
+++$$$$$|########|********|********|********

That's 2 reads, 2 shifts, 1 or, and 1 write to move 8 bits worth of info.
             _
     _     _|_  WolfWings ShadowFlight
| | | | | | | | wolfwings@lightspeed.net
| | | | | | | | "Love is a bird,
|_|_| |_|_| | |  She needs to fly...
 _           /   Let all the hurt,
 \-.______,-'    Inside of you die..." - Madonna, Frozen

Index: [thread] [date] [subject] [author]