home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / ppc / ppcCache.h < prev    next >
C/C++ Source or Header  |  1989-11-07  |  2KB  |  70 lines

  1. /*
  2.  * Copyright IBM Corporation 1987,1988,1989
  3.  *
  4.  * All Rights Reserved
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted,
  8.  * provided that the above copyright notice appear in all copies and that 
  9.  * both that copyright notice and this permission notice appear in
  10.  * supporting documentation, and that the name of IBM not be
  11.  * used in advertising or publicity pertaining to distribution of the
  12.  * software without specific, written prior permission.
  13.  *
  14.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20.  * SOFTWARE.
  21.  *
  22. */
  23. #ifndef PPC_CACHE_H
  24. #define PPC_CACHE_H
  25.  
  26. #define NUM_BAND_HEIGHTS 7
  27.  
  28. typedef struct _bmInfo {
  29.     int used;
  30.     int x;
  31.     int y;
  32.     int w;
  33.     int h;
  34.     struct _bmInfo *next, *prev;
  35.     } ppcBMInfo, *ppcBMInfoPtr;
  36.  
  37. typedef struct _bandInfo {
  38.     int plane;
  39.     int y;
  40.     int h, w;
  41.     ppcBMInfoPtr bmList, bmListTail;
  42.     int nextX;
  43.     struct _bandInfo *nextBand, *nextBandByHeight;
  44.     struct _bandInfo *prevBand, *prevBandByHeight;
  45.     } ppcBandInfo, *ppcBandInfoPtr;
  46.  
  47. typedef struct _planeInfo {
  48.     int planeNum;
  49.     int w, h;
  50.     int nextY;
  51.     ppcBandInfoPtr bandListHead;
  52.     ppcBandInfoPtr bandListTail;
  53.     } ppcPlaneInfo, *ppcPlaneInfoPtr;
  54.  
  55. typedef struct _cacheInfo {
  56.     int numPlanes;
  57.     ppcPlaneInfoPtr planes;
  58.     ppcBandInfoPtr bandsByHeight[NUM_BAND_HEIGHTS];
  59.     ppcBandInfoPtr bandsByHeightTail[NUM_BAND_HEIGHTS];
  60.     void (*blitToCache)(), (*blitToScreen)();
  61.     } ppcCacheInfo, *ppcCacheInfoPtr;
  62.  
  63.  
  64. #define BAND_HEIGHT(h) ((h+3)&(~3))
  65. #define BAND_LIST(h) ((BAND_HEIGHT(h)>>2)-2)
  66.  
  67. ppcBMInfoPtr newBM();
  68.  
  69. #endif /* PPC_CACHE_H */
  70.