Article View: comp.sys.amiga.tech
Article #3855Re: Blitting
From: Randell Jesup
Date: Fri, 08 Jun 1990 02:58
Date: Fri, 08 Jun 1990 02:58
35 lines
2523 bytes
2523 bytes
In article <ROBERTB.90Jun7171514@ulrik.uio.no> robertb@ulrik.uio.no (Robert Broughton) writes:
>Is there an easy way to copy a particular plane (the first one, for example)
>of one bit map to a different plane (the second one, for example) of another
>bit map?
>
>Why do I want to do this? My application uses a screen with four bit planes.
>I am using another RastPort, set up using InitBitMap() and InitRastPort(),
>to format text. When the text has been formatted, ClipBlit() is used to
>move it into a window. This works. The only problem is that my "workarea"
>RastPort also consists of four bit planes, and as a result, uses an outrageous
>amount of chip memory. Now, one should not really need four bit planes for
>formatting text; One should be sufficient. I could use
>ClipBlit() to move a single bit plane to the first bit plane of the "window"
>RastPort, if I set the RastPort's Mask to 0x01 (disable all bit planes
>except the first one). Unfortunately, I'm using color 1 for background, and
>color 15 for text. If I had chosen, a year ago, to use color 14 for
>background, things would work great; Moving in ClipBlit()'ing in the first
>bit plane would toggle the colors.
There is a way, which should be fairly usable. Set up all the plane
ptrs in your bitmap structure to point to the same bitplane (and say it's 4
deep). Then to make the pattern come out in color N, do 2 blits. The first
blit should use a mask for the planes you want to be a '1' (from the binary of
N), and should use a Minterm like 0xC0 (straight copy). The second blit
should cause those bits to go to 0 instead of 1 (look it up in the RKM,
I don't remember the minterm), and should specify a mask for the planes that
should be 0 in color N. Note that you'll have to modify this slightly if
you're doing "cookie-cutter" blits (doesn't sound like it).
It's a cute (but pretty standard) graphics trick.
--
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com BIX: rjesup
Common phrase heard at Amiga Devcon '89: "It's in there!"
Technical Details
Message-ID:
<12410@cbmvax.commodore.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!bpa!cbmvax!jesupReferences:
<ROBERTB.90Jun7171514@ulrik.uio.no>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!bpa!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: Blitting Message-ID: <12410@cbmvax.commodore.com> Date: 8 Jun 90 02:58:50 GMT References: <ROBERTB.90Jun7171514@ulrik.uio.no> Reply-To: jesup@cbmvax (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 35