home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 20 / amigaformatcd20.iso / -coverdisks- / af104a / fastblitter / fwb.doc < prev    next >
Text File  |  1997-09-29  |  3KB  |  105 lines

  1. **************************************************************************
  2.  
  3. FastestWaitBlit 1.0 by Olly koenders - Australia 07-09-97
  4.  
  5.  
  6. I'm often pushed to ponder, just what sort of "programmers" we have
  7. buggerisin' around with our OS.  These are a few example codes I pulled out
  8. of various patches claiming to "speed up" simple WaitBlit()!
  9.  
  10. ...First - the standard routine for OS 3.0:
  11.  
  12.         tst.b   $dff002         ;unnecessary, really
  13.         btst    #6,$dff002      ;test if blitter busy
  14.         bne.b   _one            ;if yes - then branch
  15.         rts                     ;otherwise out
  16.  
  17. _one:
  18.         tst.b   $bfe001         ;whaaaat?
  19.         tst.b   $bfe001         ;ditto..!
  20.         btst    #6,$dff002      ;blitter busy?
  21.         bne.b   _one            ;yes? - then wait some more
  22.         tst.b   $dff002         ;otherwise... [what the..?]
  23.         rts                     ;and quit (finally!)
  24.  
  25. COMMENT: [Gawd!]  Makes ya wonder what the REST of the
  26.          OS looks like eh?  [shudder!]
  27.  
  28.  
  29. ...Let's try FastWaitBlit 2.5 ~1996:
  30.  
  31.         tst.b   $dff002         ;what for?
  32.         btst    #6,$dff002      ;blitter busy?
  33.         beq.s   _out            ;if not - bye
  34.         move.l  a0,-(sp)        ;save a0 
  35.         lea     $dff002,a0      ;reason for saving a0
  36.         tst.b   (a0)            ;useless, trying to do register indirect
  37.  
  38. _one:
  39.         btst    #6,(a0)         ;blitter busy?
  40.         bne.s   _one            ;if so - branch
  41.         move.l  (sp)+,a0        ;restore a0
  42.  
  43. _out:
  44.         rts                     ;run away!
  45.  
  46. COMMENT: Don't really know WHY he's using register indirect for this, his
  47.          docs say that it's faster and of course it is, but when the
  48.          blitter's ready it's ready, and you're not gonna hurry it along
  49.          by checking it faster, and you LOSE speed by stacking and
  50.          unstacking [sigh :)]
  51.  
  52.  
  53. ...Now Apatch (beta) 20-03-97:
  54.  
  55.         btst    #6,$dff002      ;blitter busy?
  56.         beq.b   _out            ;if not - then bye
  57.  
  58. _one:
  59.         btst    #6,$dff002      ;else check again
  60.         bne.b   _one            ;if busy then branch
  61.  
  62. _out:
  63.         rts                     ;bye
  64.  
  65. COMMENT: Gettin' better, but why waste the space doin' it twice?
  66.  
  67.  
  68. ...I meself could suggest:
  69.  
  70. _one:
  71.         btst    #6,$dff002      ;blitter busy?
  72.         bne.b   _one            ;if so - wait some more
  73.         rts                     ;done
  74.  
  75.  
  76. ...Or, we could give the blitter a push to speed it up while we wait:
  77.  
  78.         move.w  #$8400,$dff096  ;switch on BLITHOG
  79.  
  80. _one:
  81.         btst    #6,$dff002      ;blitter busy?
  82.         bne.b   _one            ;if so - wait some more
  83.         move.w  #$400,$dff096   ;kill BLITHOG
  84.         rts                     ;seeya later
  85.  
  86. COMMENT: Now what's so damn hard about that?
  87.  
  88. More flames if and when I find 'em.  If anyone wants ta comment, feel free
  89. an' don't hold back :)
  90.  
  91.  
  92. FastestWaitBlit gives the blitter a push and therefore should be faster
  93. than all the rest.  Works on all Amigas, Kickstart versions and processors.
  94.  
  95. Just call it from the CLI/Shell as FWB.  The new code will be patched and
  96. FWB will quit - unlike some other patches that require "Run" or "Runback"!
  97.  
  98. Ensure that you have some fastram for it to run in, otherwise it'll be
  99. slower than the original ROM routine as the ROM is accessed at lower
  100. waitstates than chipram.  Anyhoo - enjoy :)
  101.  
  102. Olly.
  103.  
  104. Co-Nutcase A.R.G. BBS [Amiga Resource Group] +61-3-9870-4608 Land of Oz
  105.