Newsgroups: comp.sys.amiga.programmer
Path: utzoo!utgpu!watserv1!watdragon!rose!ccplumb
From: ccplumb@rose.uwaterloo.ca (Colin Plumb)
Subject: Re: Lemmings - a tutorial Part V (last)
Message-ID: <1991Apr6.223417.20213@watdragon.waterloo.edu>
Sender: news@watdragon.waterloo.edu (News Owner)
Organization: University of Waterloo
References: <2149@pdxgate.UUCP> <91089.200133DXB132@psuvm.psu.edu> <1991Mar31.202420.7137@starnet.uucp>
Date: Sat, 6 Apr 1991 22:34:17 GMT
Lines: 58

sschaem@starnet.uucp (Stephan Schaem) wrote:
> And also CED could use interlaced bitplane to eliminate any flicker!
> But no OS function suport that mode...

Sorry, but it's easy.  Do it once and forget about it.

For those who don't know, a simple trick to dramatically reduce blit
is to allocate bitplanes A and B, not as

AAAAAAAAAA
AAAAAAAAAA
AAAAAAAAAA
AAAAAAAAAA
AAAAAAAAAA

BBBBBBBBBB
BBBBBBBBBB
BBBBBBBBBB
BBBBBBBBBB
BBBBBBBBBB

but as

AAAAAAAAAA
BBBBBBBBBB
AAAAAAAAAA
BBBBBBBBBB
AAAAAAAAAA
BBBBBBBBBB
AAAAAAAAAA
BBBBBBBBBB
AAAAAAAAAA
BBBBBBBBBB

Which is equivalent to 

AAAAAAAAAABBBBBBBBBB
AAAAAAAAAABBBBBBBBBB
AAAAAAAAAABBBBBBBBBB
AAAAAAAAAABBBBBBBBBB
AAAAAAAAAABBBBBBBBBB
AAAAAAAAAABBBBBBBBBB

So you can use double-height blits on it to move rectangular chunks
around, or treat it as a double-width bitplane and draw into it.
If there are ROWBYTES bytes in a row, lie to the system and say
there are twice as many, and set the bitplane pointer for B
to A+ROWBYTES.

Anyway, to do this with the Amiga's system, you just allocate the
memory, then allocate two BitMap structures.  One claims to be
one bitplane, with twice as many lines as normal, while the other
is two bitplanes, each twice as wide as normal, and you set the
bitplane pointers carefully.

Works like a champ.
-- 
	-Colin
