home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD2.1 / includes / graphics / copper.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-11  |  2.8 KB  |  105 lines

  1. #ifndef GRAPHICS_COPPER_H
  2. #define GRAPHICS_COPPER_H
  3. /*
  4. **    $VER: copper.h 37.0 (07.01.91)
  5. **    Includes Release 38.56
  6. **
  7. **    graphics copper list intstruction definintions
  8. **
  9. **    (C) Copyright 1985-1992 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #define COPPER_MOVE 0        /* pseude opcode for move #XXXX,dir */
  18. #define COPPER_WAIT 1        /* pseudo opcode for wait y,x */
  19. #define CPRNXTBUF   2        /* continue processing with next buffer */
  20. #define CPR_NT_LOF  0x8000  /* copper instruction only for short frames */
  21. #define CPR_NT_SHT  0x4000  /* copper instruction only for long frames */
  22. #define CPR_NT_SYS  0x2000  /* copper user instruction only */
  23.  
  24. struct CopIns
  25. {
  26.     WORD   OpCode; /* 0 = move, 1 = wait */
  27.     union
  28.     {
  29.     struct CopList *nxtlist;
  30.     struct
  31.     {
  32.    union
  33.    {
  34.    WORD   VWaitPos;       /* vertical beam wait */
  35.    WORD   DestAddr;       /* destination address of copper move */
  36.    } u1;
  37.    union
  38.    {
  39.    WORD   HWaitPos;       /* horizontal beam wait position */
  40.    WORD   DestData;       /* destination immediate data to send */
  41.    } u2;
  42.     } u4;
  43.     } u3;
  44. };
  45. /* shorthand for above */
  46. #define NXTLIST     u3.nxtlist
  47. #define VWAITPOS    u3.u4.u1.VWaitPos
  48. #define DESTADDR    u3.u4.u1.DestAddr
  49. #define HWAITPOS    u3.u4.u2.HWaitPos
  50. #define DESTDATA    u3.u4.u2.DestData
  51.  
  52.  
  53. /* structure of cprlist that points to list that hardware actually executes */
  54. struct cprlist
  55. {
  56.     struct cprlist *Next;
  57.     UWORD   *start;        /* start of copper list */
  58.     WORD   MaxCount;       /* number of long instructions */
  59. };
  60.  
  61. struct CopList
  62. {
  63.     struct  CopList *Next;  /* next block for this copper list */
  64.     struct  CopList *_CopList;    /* system use */
  65.     struct  ViewPort *_ViewPort;    /* system use */
  66.     struct  CopIns *CopIns; /* start of this block */
  67.     struct  CopIns *CopPtr; /* intermediate ptr */
  68.     UWORD   *CopLStart;     /* mrgcop fills this in for Long Frame*/
  69.     UWORD   *CopSStart;     /* mrgcop fills this in for Short Frame*/
  70.     WORD   Count;       /* intermediate counter */
  71.     WORD   MaxCount;       /* max # of copins for this block */
  72.     WORD   DyOffset;       /* offset this copper list vertical waits */
  73. #ifdef V1_3
  74.     UWORD   *Cop2Start;
  75.     UWORD   *Cop3Start;
  76.     UWORD   *Cop4Start;
  77.     UWORD   *Cop5Start;
  78. #endif
  79. };
  80.  
  81. struct UCopList
  82. {
  83.     struct UCopList *Next;
  84.     struct CopList  *FirstCopList; /* head node of this copper list */
  85.     struct CopList  *CopList;       /* node in use */
  86. };
  87.  
  88. /* private graphics data structure */
  89.  
  90. struct copinit
  91. {
  92.     UWORD vsync_hblank[2];
  93.     UWORD diwstart[4];
  94.     UWORD diagstrt[4];        /* copper list for first bitplane */
  95.     UWORD sprstrtup[(2*8*2)];
  96.     UWORD wait14[2];
  97.     UWORD norm_hblank[2];
  98.     UWORD genloc[4];
  99.     UWORD jump[(2*2)];
  100.     UWORD wait_forever[2];
  101.     UWORD   sprstop[4];
  102. };
  103.  
  104. #endif    /* GRAPHICS_COPPER_H */
  105.