home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / System / Mesa-3.1 / src / AOS / NOTES < prev    next >
Text File  |  1999-09-23  |  3KB  |  95 lines

  1. /*
  2.  * some notes for optimizing m68k-code in C:
  3.  *
  4.  ******
  5.  *
  6.  *  short int c;
  7.  *  for (c = n - 1; c >= 0; c--);
  8.  *
  9.  *  produces dbra
  10.  *
  11.  ******
  12.  *
  13.  *  int c;
  14.  *  for (c = n - 1; c >= 0; c--);
  15.  *
  16.  *  produces swap/dbra/swap/dbra
  17.  *  or dbra/dbra
  18.  *
  19.  ******
  20.  *
  21.  * some notes on the cpu:
  22.  *
  23.  *  asm: -(a0) is faster than (a0)+
  24.  *  C  : *--a  is faster than *a++
  25.  *
  26.  *  asm: add/sub doesn't matter
  27.  *  C  : a++/++a/a--/--a doesn't matter
  28.  *
  29.  ******
  30.  *
  31.  * fast linear-time integer log2
  32.  *
  33.  *  __inline extern int
  34.  * ilog2(int in)
  35.  * {
  36.  *   register int lg __asm__ ("d0");
  37.  *   register const int tt = 32;
  38.  * 
  39.  *   __asm ("bfffo    %1{#0,%2},%0
  40.  *     sub%.l    %2,%0
  41.  *     not%.l    %0"
  42.  *     : "=d" (lg)
  43.  *     : "m<>d" (in)
  44.  *     , "d" (tt)
  45.  *     : "cc");
  46.  *   return lg;
  47.  * }
  48.  */
  49.  
  50. /*
  51.  * Note that you'll usually have to flip Y coordinates since Mesa's
  52.  * window coordinates start at the bottom and increase upward.  Most
  53.  * window system's Y-axis increases downward
  54.  *
  55.  * See dd.h for more device driver info.
  56.  * See the other device driver implementations for ideas.
  57.  *
  58.  */
  59.  
  60. /*
  61.  * The Drawing area is defined by:
  62.  * 
  63.  * CC.Viewport.X = x;
  64.  * CC.Viewport.Width = width;
  65.  * CC.Viewport.Y = y;
  66.  * CC.Viewport.Height = height;
  67.  */
  68.  
  69. /*
  70.  * Implementions of new drawing rutines:
  71.  * 
  72.  * you implement a own init for your rutines/hardware
  73.  * and make some test and calls it from AmigaMesaCreateContext()
  74.  * (look in the file src/amigamesa.c I'll thing you get it)
  75.  * Be sure to fill this three ponters out:
  76.  * void (*InitDD)( void );                                 // keep track of witch drawing rutines should be used
  77.  * void (*Dispose) (amigaMesaContext *c);  // Use this when AmigaMesaDestroyContext is called 
  78.  * void (*SwapBuffer) (void);                              // Use this when AmigaMesaSwapBuffers is called 
  79.  * where InitDD sets the DD structure in orginal mesa with pointers to drawing rutines
  80.  * Dispose is called when someone quits/closes down your made inits
  81.  * SwapBuffer is called when one is changing buffer in dubble buffering mode
  82.  * 
  83.  * Write nice drawing rutines like those in src/amigamesa.c on make sure
  84.  * that it's those you set in your InitDD rutine.
  85.  * 
  86.  * Add enum for your drawingmode for the taglist and if you need more tags also implement them
  87.  * If posible some autodetection code in AmigaMesaCreateContext
  88.  * Add enums and error codes if you neads 
  89.  * 
  90.  * PUT ALL YOUR NEADED DATA IN amigamesa_context->(void *)data in for your gfx driver
  91.  * private structure.
  92.  * 
  93.  * Send the code to me and I will include it in the main code.
  94.  */
  95.