
           ========================================================
                               FastWaitBlit 2.12
           ========================================================
                    Copyright © 1995, 1996, 1997 Dave Jones
                              All rights reserved
           --------------------------------------------------------
                    GiftWare - Please send me **anything!**
           --------------------------------------------------------

*************
Distribution:
*************
It is forbidden to include this on a magazine coverdisk without first
writing to me to make sure you include the latest version, and also,
I want a copy of the magazine featuring FastWaitBlit.
No other limitations are implied on FWB's distribution.


************
Requirements
************
Any Amiga, with standard blitter, (Untested on custom gfx cards - Please
give me feedback on this issue)
Some fastram is also needed, as running my waitblit code from Chipram
will result in a slower performance than the ROM code, which runs at
lower wait states.


***********
BackGround:
***********

There exists a routine called WaitBlit() in all Amiga KickStarts, which
simply waits until the blitter has finished it's current work (Called a
blit), so we know when to load it with more data.
Whilst the blitter is busy, the CPU idles, swapping to other tasks e.t.c.
The Amiga hardware also contains a bit called BLITHOG which means the
blitter DMA gets more cycles than the CPU, which in turn, means that
blit's get done quicker, at the expense of less CPU time.

This very small program will reprogram the WaitBlit() function to set
BlitHog whilst waiting for a blit to complete, and then clears BlitHog
when it has completed, returning full bandwidth to the CPU.

The drawback of this, is that multitasking is slowed slightly (In theory)
but only while blits are taking place. This drawback does not have any
visible effect on the user, and actually (IMHO) makes the system MORE
productive, as the program you are currently using will wait less.

FastWaitblit needs Kickstart 2.0 or above, if any 1.3 freaks would like
me to add compatability, please email (or snailmail) me, as it's not
much work, but results in an ever-so slightly bigger executable.

Even without the BLITHOG stuff, the actual wait routine is also faster
than CBM's, and should be compatable on all Amigas.. (I hope)

Things that should be notacibly faster with FastWaitBlit installed are
menu browsing, WB updating, text scrolling and benchmark programs that
tests the gfx capabilities (like AIBB).
To use this program, run it from CLI, or just add it to your startup-
sequence or user-startup.


******
Notes:
******
There is a program on Aminet, called FastBlit. Which claims to speed up
blitter operations, much like my program, however it works in a different
way, in that it does not patch any functions, but just sets the BlitHog
bit and exits, This has two drawbacks -
1. Another program (Such as mine) will clear the bit again.
2. Even if the blitter isn't busy, it gets more cycles than the CPU,
   which means that whilst not performing graphics functions, your
   Amiga is actually going slower. (Especially on faster CPU's)

Another program to watch for is the patch `FasterBlit' by Arthur Hagen.
It has several patches, and by default, turns on BlitHog.
I suggest turning off blithog, by specifying the SLOW parameter to Fasterblit.
You will score less gfx benchmarks, but the CPU will get more priority, and
will multitask faster.
Alternatively, if you'd prefer faster gfx performance, use the NODMA version
of FastWaitblit in conjunction with FasterBlit.


********
History:
********

v1.0: Release date 2-11-95
 First version, just an optimised version of the 3.0 WaitBlit()

v2.0: Release date 2-5-96
 Added some lines to increase blitter speed whilst waiting for the
 current blit to finish.

v2.1: Release date 3-5-96
 Tests if the blitter is busy first, if not, doesn't bother setting
 and clearing BlitHog.

v2.2: Release date 4-5-96
 Now, the patch code is 32bit aligned for increased performance
 on 68020 and greater CPU's.

v2.3: Release date 19-5-96
 Now, the patch is allocated at the top of memory (Memf_reverse)
 Also now hardware registers in the new waitblit are addressed indirectly,
 which means a tiny increase in speed at the cost of 4 bytes stack space ;^)

v2.4: Release date 6-6-96 *(666!)
 Removed one instruction from the patch, so it should run a few milliseconds
 faster ;^)

v2.5: Release date 22-6-96
 Added a version to the archive which doesn't feature Dynamic DMA setting.
 This means, faster gfx performance, at the cost of lower CPU performance.

v2.6: Release date 9-7-96
 Replaced the instruction I removed in v2.4, as it was causing pixel-trash
 on some programs.

v2.7: Release date 21-9-96
 Now using faster methods of bit-testing, also aligned busy-loop onto 32bit
 boundary, giving higher performance.

v2.8: Release date 2-Oct-96
 Added cache clear code to the remove routine.
 Added Checksumming of library after installing/removing patch.

v2.9: Release date 16-Nov-96
 Removed some instructions, patch is now real fast.

v2.10: Release date 4-Mar-97
 Removed Checksumming of library, as SetFunction() does this itself.

v2.11: Release date 13-Mar-97
 Incorporated some great ideas by Adam Polkosnik. Code is now several
 cycles faster. Thanks Adam!
 The NODMA version now doesn't touch the blitter-nasty bit at all.
 If you want it switched on permanently, then use some other tool.
 (Such as *Art's FasterBlit)

v2.12: Release date 28-Mar-97
 Adam pointed out a way to save another 2 cycles ;-)

**************
Contact Stuff:
**************

 Email: DJones@CardiffCyberCafe.Co.Uk

 SNAIL:
        Dave Jones.
        40,Heol Edward Lewis,
           Gelligaer,
           Hengoed,
           Mid Glamorgan,
           Cf82 8ej,
           South Wales,
           United Kingdom.

        Include postage if you require a reply. If you are just requesting an
        update, then I will hold onto your postage until the next release is
        ready. If you are not residing in the Uk, then just send two extra
        disks as payment.

 EMAIL:
        DJones@CardiffCyberCafe.Co.Uk

        *NB*
        If you need to contact me, and this address no longer works, use the
        whowhere web-site to find my current email address.
        Just look at  http://people.whowhere.com/pages/termy

 IRC:
        server : irc.demon.co.uk port 6665
        nick   : Termy
        channel: #Amiga, #Asm
        when   : most saturday afternoons GMT
        misc   : Should my email/WWW addresses change, The Darxide bot should
                 always have my current addresses, so ask someone with a status
                 level 10+ to type `Email Termy' for you ;^)

  WWW:
        http://www-personal.usyd.edu.au/~amann/main.html

*********
About Me:
*********

I'm a 23 year old hobby programmer, interested in anything Amiga, currently
working as a Data Entry Clerk (Which sucks) As of September `97, I start at
the University of Glamorgan studying Software Engineering.
