home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / useful / os-include / graphics / view.h < prev    next >
C/C++ Source or Header  |  1992-09-24  |  8KB  |  288 lines

  1. #ifndef GRAPHICS_VIEW_H
  2. #define GRAPHICS_VIEW_H
  3. /*
  4. **    $VER: view.h 39.28 (27.08.92)
  5. **    Includes Release 39.108
  6. **
  7. **    graphics view/viewport definintions
  8. **
  9. **    (C) Copyright 1985-1992 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #define ECS_SPECIFIC
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef EXEC_SEMAPHORES_H
  20. #include <exec/semaphores.h>
  21. #endif
  22.  
  23. #ifndef GRAPHICS_GFX_H
  24. #include <graphics/gfx.h>
  25. #endif
  26.  
  27. #ifndef GRAPHICS_COPPER_H
  28. #include <graphics/copper.h>
  29. #endif
  30.  
  31. #ifndef GRAPHICS_GFXNODES_H
  32. #include <graphics/gfxnodes.h>
  33. #endif
  34.  
  35. #ifndef GRAPHICS_MONITOR_H
  36. #include <graphics/monitor.h>
  37. #endif
  38.  
  39. #ifndef GRAPHICS_DISPLAYINFO_H
  40. #include <graphics/displayinfo.h>
  41. #endif
  42.  
  43. #ifndef HARDWARE_CUSTOM_H
  44. #include <hardware/custom.h>
  45. #endif
  46.  
  47. struct ViewPort
  48. {
  49.     struct    ViewPort *Next;
  50.     struct    ColorMap *ColorMap;    /* table of colors for this viewport */
  51.                     /* if this is nil, MakeVPort assumes default values */
  52.     struct    CopList  *DspIns;    /* user by MakeView() */
  53.     struct    CopList  *SprIns;    /* used by sprite stuff */
  54.     struct    CopList  *ClrIns;    /* used by sprite stuff */
  55.     struct    UCopList *UCopIns;    /* User copper list */
  56.     WORD    DWidth,DHeight;
  57.     WORD    DxOffset,DyOffset;
  58.     UWORD    Modes;
  59.     UBYTE    SpritePriorities;    /* used by makevp */
  60.     UBYTE    ExtendedModes;
  61.     struct    RasInfo *RasInfo;
  62. };
  63.  
  64. struct View
  65. {
  66.     struct    ViewPort *ViewPort;
  67.     struct    cprlist *LOFCprList;   /* used for interlaced and noninterlaced */
  68.     struct    cprlist *SHFCprList;   /* only used during interlace */
  69.     WORD    DyOffset,DxOffset;   /* for complete View positioning */
  70.                    /* offsets are +- adjustments to standard #s */
  71.     UWORD    Modes;           /* such as INTERLACE, GENLOC */
  72. };
  73.  
  74. /* these structures are obtained via GfxNew */
  75. /* and disposed by GfxFree */
  76. struct ViewExtra
  77. {
  78.     struct ExtendedNode n;
  79.     struct View *View;        /* backwards link */
  80.     struct MonitorSpec *Monitor;    /* monitors for this view */
  81.     UWORD TopLine;
  82. };
  83.  
  84. /* this structure is obtained via GfxNew */
  85. /* and disposed by GfxFree */
  86. struct ViewPortExtra
  87. {
  88.     struct ExtendedNode n;
  89.     struct ViewPort *ViewPort;    /* backwards link */
  90.     struct Rectangle DisplayClip;    /* makevp display clipping information */
  91.     /* These are added for V39 */
  92.     APTR   VecTable;        /* Private */
  93.     APTR   DriverData[2];
  94.     UWORD  Flags;
  95.     Point  Origin[2];        /* First visible point relative to the DClip.
  96.                      * One for each possible playfield.
  97.                      */
  98. };
  99.  
  100. #define VPXB_FREE_ME        0    /* private */
  101. #define VPXF_FREE_ME        (1 << VPXB_FREE_ME)
  102. #define VPXB_LAST        1
  103. #define VPXF_LAST        (1 << VPXB_LAST)
  104. #define VPXB_STRADDLES_256    4
  105. #define VPXF_STRADDLES_256    (1 << VPXB_STRADDLES_256)
  106. #define VPXB_STRADDLES_512    5
  107. #define VPXF_STRADDLES_512    (1 << VPXB_STRADDLES_512)
  108.  
  109. #define EXTEND_VSTRUCT    0x1000    /* unused bit in Modes field of View */
  110.  
  111. #define VPF_A2024          0x40    /* VP?_ fields internal only */
  112. #define VPF_TENHZ          0x20
  113. #define VPB_A2024          6
  114. #define VPB_TENHZ          4
  115.  
  116. /* defines used for Modes in IVPargs */
  117.  
  118. #define GENLOCK_VIDEO    0x0002
  119. #define LACE        0x0004
  120. #define DOUBLESCAN    0x0008
  121. #define SUPERHIRES    0x0020
  122. #define PFBA        0x0040
  123. #define EXTRA_HALFBRITE 0x0080
  124. #define GENLOCK_AUDIO    0x0100
  125. #define DUALPF        0x0400
  126. #define HAM        0x0800
  127. #define EXTENDED_MODE    0x1000
  128. #define VP_HIDE    0x2000
  129. #define SPRITES    0x4000
  130. #define HIRES        0x8000
  131.  
  132. struct RasInfo    /* used by callers to and InitDspC() */
  133. {
  134.    struct   RasInfo *Next;        /* used for dualpf */
  135.    struct   BitMap *BitMap;
  136.    WORD    RxOffset,RyOffset;       /* scroll offsets in this BitMap */
  137. };
  138.  
  139. struct ColorMap
  140. {
  141.     UBYTE    Flags;
  142.     UBYTE    Type;
  143.     UWORD    Count;
  144.     APTR    ColorTable;
  145.     struct    ViewPortExtra *cm_vpe;
  146.     APTR    LowColorBits;
  147.     UBYTE    TransparencyPlane;
  148.     UBYTE    SpriteResolution;
  149.     UBYTE    SpriteResDefault;    /* what resolutiion you get when you have set SPRITERESN_DEFAULT */
  150.     UBYTE    AuxFlags;
  151.     struct    ViewPort *cm_vp;
  152.     APTR    NormalDisplayInfo;
  153.     APTR    CoerceDisplayInfo;
  154.     struct    TagItem *cm_batch_items;
  155.     ULONG    VPModeID;
  156.     struct    PaletteExtra *PalExtra;
  157.     UWORD    SpriteBase_Even;
  158.     UWORD    SpriteBase_Odd;
  159.     UWORD    Bp_0_base;
  160.     UWORD    Bp_1_base;
  161.  
  162. };
  163.  
  164. /* if Type == 0 then ColorMap is V1.2/V1.3 compatible */
  165. /* if Type != 0 then ColorMap is V38       compatible */
  166. /* the system will never create other than V39 type colormaps when running V39 */
  167.  
  168. #define COLORMAP_TYPE_V1_2    0x00
  169. #define COLORMAP_TYPE_V1_4    0x01
  170. #define COLORMAP_TYPE_V36 COLORMAP_TYPE_V1_4    /* use this definition */
  171. #define COLORMAP_TYPE_V39    0x02
  172.  
  173. /* Flags variable */
  174. #define COLORMAP_TRANSPARENCY    0x01
  175. #define COLORPLANE_TRANSPARENCY    0x02
  176. #define BORDER_BLANKING        0x04
  177. #define BORDER_NOTRANSPARENCY    0x08
  178. #define VIDEOCONTROL_BATCH    0x10
  179. #define USER_COPPER_CLIP    0x20
  180. #define BORDERSPRITES    0x40
  181.  
  182. #define CMF_CMTRANS    0
  183. #define CMF_CPTRANS    1
  184. #define CMF_BRDRBLNK    2
  185. #define CMF_BRDNTRAN    3
  186. #define CMF_BRDRSPRT    6
  187.  
  188. #define SPRITERESN_ECS        0
  189. /* ^140ns, except in 35ns viewport, where it is 70ns. */
  190. #define SPRITERESN_140NS    1
  191. #define SPRITERESN_70NS        2
  192. #define SPRITERESN_35NS        3
  193. #define SPRITERESN_DEFAULT    -1
  194.  
  195. /* AuxFlags : */
  196. #define CMAB_FULLPALETTE 0
  197. #define CMAF_FULLPALETTE (1<<CMAB_FULLPALETTE)
  198.  
  199.  
  200. struct PaletteExtra                /* structure may be extended so watch out! */
  201. {
  202.     struct SignalSemaphore pe_Semaphore;        /* shared semaphore for arbitration    */
  203.     UWORD    pe_FirstFree;                /* *private*                */
  204.     UWORD    pe_NFree;                /* number of free colors        */
  205.     UWORD    pe_FirstShared;                /* *private*                */
  206.     UWORD    pe_NShared;                /* *private*                */
  207.     UBYTE    *pe_RefCnt;                /* *private*                */
  208.     UBYTE    *pe_AllocList;                /* *private*                */
  209.     struct ViewPort *pe_ViewPort;            /* back pointer to viewport        */
  210.     UWORD    pe_SharableColors;            /* the number of sharable colors.    */
  211. };
  212.  
  213. /* flags values for ObtainPen */
  214.  
  215. #define PENB_EXCLUSIVE 0
  216. #define PENB_NO_SETCOLOR 1
  217.  
  218. #define PENF_EXCLUSIVE (1l<<PENB_EXCLUSIVE)
  219. #define PENF_NO_SETCOLOR (1l<<PENB_NO_SETCOLOR)
  220.  
  221. /* obsolete names for PENF_xxx flags: */
  222.  
  223. #define PEN_EXCLUSIVE PENF_EXCLUSIVE
  224. #define PEN_NO_SETCOLOR PENF_NO_SETCOLOR
  225.  
  226. /* precision values for ObtainBestPen : */
  227.  
  228. #define PRECISION_EXACT    -1
  229. #define PRECISION_IMAGE    0
  230. #define PRECISION_ICON    16
  231. #define PRECISION_GUI    32
  232.  
  233.  
  234. /* tags for ObtainBestPen: */
  235. #define OBP_Precision 0x84000000
  236. #define OBP_FailIfBad 0x84000001
  237.  
  238. /* From V39, MakeVPort() will return an error if there is not enough memory,
  239.  * or the requested mode cannot be opened with the requested depth with the
  240.  * given bitmap (for higher bandwidth alignments).
  241.  */
  242.  
  243. #define MVP_OK        0    /* you want to see this one */
  244. #define MVP_NO_MEM    1    /* insufficient memory for intermediate workspace */
  245. #define MVP_NO_VPE    2    /* ViewPort does not have a ViewPortExtra, and
  246.                  * insufficient memory to allocate a temporary one.
  247.                  */
  248. #define MVP_NO_DSPINS    3    /* insufficient memory for intermidiate copper
  249.                  * instructions.
  250.                  */
  251. #define MVP_NO_DISPLAY    4    /* BitMap data is misaligned for this viewport's
  252.                  * mode and depth - see AllocBitMapData().
  253.                  */
  254.  
  255. /* From V39, MrgCop() will return an error if there is not enough memory,
  256.  * or for some reason MrgCop() did not need to make any copper lists.
  257.  */
  258.  
  259. #define MCOP_OK        0    /* you want to see this one */
  260. #define MCOP_NO_MEM    1    /* insufficient memory to allocate the system
  261.                  * copper lists.
  262.                  */
  263. #define MCOP_NOP    2    /* MrgCop() did not merge any copper lists
  264.                  * (eg, no ViewPorts in the list, or all marked as
  265.                  * hidden).
  266.                  */
  267.  
  268. struct DBufInfo {
  269.     APTR    dbi_Link1;
  270.     ULONG    dbi_Count1;
  271.     struct Message dbi_SafeMessage;        /* replied to when safe to write to old bitmap */
  272.     APTR dbi_UserData1;            /* first user data */
  273.  
  274.     APTR    dbi_Link2;
  275.     ULONG    dbi_Count2;
  276.     struct Message dbi_DispMessage;    /* replied to when new bitmap has been displayed at least
  277.                             once */
  278.     APTR    dbi_UserData2;            /* second user data */
  279.     ULONG    dbi_MatchLong;
  280.     APTR    dbi_CopPtr1;
  281.     APTR    dbi_CopPtr2;
  282.     APTR    dbi_CopPtr3;
  283.     UWORD    dbi_BeamPos1;
  284.     UWORD    dbi_BeamPos2;
  285. };
  286.  
  287. #endif    /* GRAPHICS_VIEW_H */
  288.