home *** CD-ROM | disk | FTP | other *** search
- Path: informatik.tu-muenchen.de!fischerj
- From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Fastest way to clear a Window?
- Date: 9 Feb 1996 15:23:48 GMT
- Organization: Technische Universitaet Muenchen, Germany
- Distribution: world
- Message-ID: <4ffou4$dne@sunsystem5.informatik.tu-muenchen.de>
- References: <4fck5b$7mm@leofric.coventry.ac.uk> <4fcush$58b@apoll.informatik.uni-bonn.de>
- NNTP-Posting-Host: hphalle5.informatik.tu-muenchen.de
- Originator: fischerj@hphalle5.informatik.tu-muenchen.de
-
-
- In article <4fcush$58b@apoll.informatik.uni-bonn.de>, malerz@athene.informatik.uni-bonn.de (Andreas Malerz) writes:
- |> Organization: Rheinische Friedrich-Wilhelms-Universit"at Bonn, Institut
- |> Lines: 30
- |> Message-ID: <4fcush$58b@apoll.informatik.uni-bonn.de>
- |> References: <4fck5b$7mm@leofric.coventry.ac.uk>
- |> NNTP-Posting-Host: malve.informatik.uni-bonn.de
- |> X-Newsreader: TIN [version 1.2 PL2]
- |>
- |> Dave Jackson (dj@coventry.ac.uk) wrote:
- |> : I'm writing a 3d graphics viewer thingy using intuition windows. What I
- |> : want to know is, what is the fastest way of clearing a window? At the
- |> : moment I'm using SetRast() but there must be a faster way. I'm using a
- |> : custom screen, so I could make it draw lines on a single bitplane and
- |> : then just clear that one plane, but the RKM:Libraries has nothing on how
- |> : to clear one plane... help!
-
- sorry don't know, but why do you want to clear a window quick ?
- do you intend to clear and then draw ?
-
- this might flicker...
-
- I'd build the 3d object in mem. IF a point averagely is overwritten
- more than about 2 times, rendering to fastmem and then copying to
- a chipmem bitmap is faster.
- When done, copy the bitmap into the window with blitbitmaprastport().
-
- Don't know about the 1-plane problem, though...
-
- |>
- |> : TIA
- |> : Dave Jackson
- |>
- |> Depending on your processor, you can try to do it with the CPU itself.
- |> The fastest way I know is the following:
- |>
- |> Save all registers on STACK
- |> Save STACK-Pointer somewhere else
- |>
- |> Clear all registers
- |> Put the Address of your bitplane in one Adressregister
- |> Copy the registers to your plane with "movem"
- |> Do the last step as often as necessary.
- |>
- |> Restore STACK-Pointer
- |> Restore all registers.
- |>
- |> This solution is systemfriendly and on a fast processor faster than the
- |> blitter.
-
- a) it is not systemfriendly, as you must turn off interrupt
- if sp doesn't point to enough free space.
-
- b) Forgett all that movem crap unless you're not on a A500.
- on A1200, this is the loop you can't beat:
-
- clear:
- move.l d0,(a0)+
- dbra d7,clear
-
- This runs 8cycles/longword on A1200 and you won't get it faster
- (The dbra doesn't disturb, "free cycles" on 020+).
-
- BTW this method might not be useful for clearing windows...
-
- |>
- |> Best greetings,
- |> Andy.
- ------------------------------------------------------------------------
- fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) =:)
-
-