home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / at-inc-bin.lha / os-include / graphics / view.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  8KB  |  299 lines

  1. #ifndef GRAPHICS_VIEW_H
  2. #define GRAPHICS_VIEW_H
  3. /*
  4. **    $VER: view.h 39.34 (31.5.93)
  5. **    Includes Release 40.15
  6. **
  7. **    graphics view/viewport definintions
  8. **
  9. **    (C) Copyright 1985-1993 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;    /* used by MakeVPort() */
  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;
  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;    /* MakeVPort 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.     ULONG cop1ptr;            /* private */
  99.     ULONG cop2ptr;            /* private */
  100. };
  101.  
  102. /* All these VPXF_ flags are private */
  103. #define VPXB_FREE_ME        0
  104. #define VPXF_FREE_ME        (1 << VPXB_FREE_ME)
  105. #define VPXB_LAST        1
  106. #define VPXF_LAST        (1 << VPXB_LAST)
  107. #define VPXB_STRADDLES_256    4
  108. #define VPXF_STRADDLES_256    (1 << VPXB_STRADDLES_256)
  109. #define VPXB_STRADDLES_512    5
  110. #define VPXF_STRADDLES_512    (1 << VPXB_STRADDLES_512)
  111.  
  112.  
  113. #define EXTEND_VSTRUCT    0x1000    /* unused bit in Modes field of View */
  114.  
  115. #define VPF_A2024          0x40    /* VP?_ fields internal only */
  116. #define VPF_TENHZ          0x20
  117. #define VPB_A2024          6
  118. #define VPB_TENHZ          4
  119.  
  120. /* defines used for Modes in IVPargs */
  121.  
  122. #define GENLOCK_VIDEO    0x0002
  123. #define LACE        0x0004
  124. #define DOUBLESCAN    0x0008
  125. #define SUPERHIRES    0x0020
  126. #define PFBA        0x0040
  127. #define EXTRA_HALFBRITE 0x0080
  128. #define GENLOCK_AUDIO    0x0100
  129. #define DUALPF        0x0400
  130. #define HAM        0x0800
  131. #define EXTENDED_MODE    0x1000
  132. #define VP_HIDE    0x2000
  133. #define SPRITES    0x4000
  134. #define HIRES        0x8000
  135.  
  136. struct RasInfo    /* used by callers to and InitDspC() */
  137. {
  138.    struct   RasInfo *Next;        /* used for dualpf */
  139.    struct   BitMap *BitMap;
  140.    WORD    RxOffset,RyOffset;       /* scroll offsets in this BitMap */
  141. };
  142.  
  143. struct ColorMap
  144. {
  145.     UBYTE    Flags;
  146.     UBYTE    Type;
  147.     UWORD    Count;
  148.     APTR    ColorTable;
  149.     struct    ViewPortExtra *cm_vpe;
  150.     APTR    LowColorBits;
  151.     UBYTE    TransparencyPlane;
  152.     UBYTE    SpriteResolution;
  153.     UBYTE    SpriteResDefault;    /* what resolution you get when you have set SPRITERESN_DEFAULT */
  154.     UBYTE    AuxFlags;
  155.     struct    ViewPort *cm_vp;
  156.     APTR    NormalDisplayInfo;
  157.     APTR    CoerceDisplayInfo;
  158.     struct    TagItem *cm_batch_items;
  159.     ULONG    VPModeID;
  160.     struct    PaletteExtra *PalExtra;
  161.     UWORD    SpriteBase_Even;
  162.     UWORD    SpriteBase_Odd;
  163.     UWORD    Bp_0_base;
  164.     UWORD    Bp_1_base;
  165.  
  166. };
  167.  
  168. /* if Type == 0 then ColorMap is V1.2/V1.3 compatible */
  169. /* if Type != 0 then ColorMap is V38       compatible */
  170. /* the system will never create other than V39 type colormaps when running V39 */
  171.  
  172. #define COLORMAP_TYPE_V1_2    0x00
  173. #define COLORMAP_TYPE_V1_4    0x01
  174. #define COLORMAP_TYPE_V36 COLORMAP_TYPE_V1_4    /* use this definition */
  175. #define COLORMAP_TYPE_V39    0x02
  176.  
  177. /* Flags variable */
  178. #define COLORMAP_TRANSPARENCY    0x01
  179. #define COLORPLANE_TRANSPARENCY    0x02
  180. #define BORDER_BLANKING        0x04
  181. #define BORDER_NOTRANSPARENCY    0x08
  182. #define VIDEOCONTROL_BATCH    0x10
  183. #define USER_COPPER_CLIP    0x20
  184. #define BORDERSPRITES    0x40
  185.  
  186. #define CMF_CMTRANS    0
  187. #define CMF_CPTRANS    1
  188. #define CMF_BRDRBLNK    2
  189. #define CMF_BRDNTRAN    3
  190. #define CMF_BRDRSPRT    6
  191.  
  192. #define SPRITERESN_ECS        0
  193. /* ^140ns, except in 35ns viewport, where it is 70ns. */
  194. #define SPRITERESN_140NS    1
  195. #define SPRITERESN_70NS        2
  196. #define SPRITERESN_35NS        3
  197. #define SPRITERESN_DEFAULT    -1
  198.  
  199. /* AuxFlags : */
  200. #define CMAB_FULLPALETTE 0
  201. #define CMAF_FULLPALETTE (1<<CMAB_FULLPALETTE)
  202. #define CMAB_NO_INTERMED_UPDATE 1
  203. #define CMAF_NO_INTERMED_UPDATE (1<<CMAB_NO_INTERMED_UPDATE)
  204. #define CMAB_NO_COLOR_LOAD 2
  205. #define CMAF_NO_COLOR_LOAD (1 << CMAB_NO_COLOR_LOAD)
  206. #define CMAB_DUALPF_DISABLE 3
  207. #define CMAF_DUALPF_DISABLE (1 << CMAB_DUALPF_DISABLE)
  208.  
  209.  
  210. struct PaletteExtra                /* structure may be extended so watch out! */
  211. {
  212.     struct SignalSemaphore pe_Semaphore;        /* shared semaphore for arbitration    */
  213.     UWORD    pe_FirstFree;                /* *private*                */
  214.     UWORD    pe_NFree;                /* number of free colors        */
  215.     UWORD    pe_FirstShared;                /* *private*                */
  216.     UWORD    pe_NShared;                /* *private*                */
  217.     UBYTE    *pe_RefCnt;                /* *private*                */
  218.     UBYTE    *pe_AllocList;                /* *private*                */
  219.     struct ViewPort *pe_ViewPort;            /* back pointer to viewport        */
  220.     UWORD    pe_SharableColors;            /* the number of sharable colors.    */
  221. };
  222.  
  223. /* flags values for ObtainPen */
  224.  
  225. #define PENB_EXCLUSIVE 0
  226. #define PENB_NO_SETCOLOR 1
  227.  
  228. #define PENF_EXCLUSIVE (1l<<PENB_EXCLUSIVE)
  229. #define PENF_NO_SETCOLOR (1l<<PENB_NO_SETCOLOR)
  230.  
  231. /* obsolete names for PENF_xxx flags: */
  232.  
  233. #define PEN_EXCLUSIVE PENF_EXCLUSIVE
  234. #define PEN_NO_SETCOLOR PENF_NO_SETCOLOR
  235.  
  236. /* precision values for ObtainBestPen : */
  237.  
  238. #define PRECISION_EXACT    -1
  239. #define PRECISION_IMAGE    0
  240. #define PRECISION_ICON    16
  241. #define PRECISION_GUI    32
  242.  
  243.  
  244. /* tags for ObtainBestPen: */
  245. #define OBP_Precision 0x84000000
  246. #define OBP_FailIfBad 0x84000001
  247.  
  248. /* From V39, MakeVPort() will return an error if there is not enough memory,
  249.  * or the requested mode cannot be opened with the requested depth with the
  250.  * given bitmap (for higher bandwidth alignments).
  251.  */
  252.  
  253. #define MVP_OK        0    /* you want to see this one */
  254. #define MVP_NO_MEM    1    /* insufficient memory for intermediate workspace */
  255. #define MVP_NO_VPE    2    /* ViewPort does not have a ViewPortExtra, and
  256.                  * insufficient memory to allocate a temporary one.
  257.                  */
  258. #define MVP_NO_DSPINS    3    /* insufficient memory for intermidiate copper
  259.                  * instructions.
  260.                  */
  261. #define MVP_NO_DISPLAY    4    /* BitMap data is misaligned for this viewport's
  262.                  * mode and depth - see AllocBitMap().
  263.                  */
  264. #define MVP_OFF_BOTTOM    5    /* PRIVATE - you will never see this. */
  265.  
  266. /* From V39, MrgCop() will return an error if there is not enough memory,
  267.  * or for some reason MrgCop() did not need to make any copper lists.
  268.  */
  269.  
  270. #define MCOP_OK        0    /* you want to see this one */
  271. #define MCOP_NO_MEM    1    /* insufficient memory to allocate the system
  272.                  * copper lists.
  273.                  */
  274. #define MCOP_NOP    2    /* MrgCop() did not merge any copper lists
  275.                  * (eg, no ViewPorts in the list, or all marked as
  276.                  * hidden).
  277.                  */
  278.  
  279. struct DBufInfo {
  280.     APTR    dbi_Link1;
  281.     ULONG    dbi_Count1;
  282.     struct Message dbi_SafeMessage;        /* replied to when safe to write to old bitmap */
  283.     APTR dbi_UserData1;            /* first user data */
  284.  
  285.     APTR    dbi_Link2;
  286.     ULONG    dbi_Count2;
  287.     struct Message dbi_DispMessage;    /* replied to when new bitmap has been displayed at least
  288.                             once */
  289.     APTR    dbi_UserData2;            /* second user data */
  290.     ULONG    dbi_MatchLong;
  291.     APTR    dbi_CopPtr1;
  292.     APTR    dbi_CopPtr2;
  293.     APTR    dbi_CopPtr3;
  294.     UWORD    dbi_BeamPos1;
  295.     UWORD    dbi_BeamPos2;
  296. };
  297.  
  298. #endif    /* GRAPHICS_VIEW_H */
  299.