1 #ifndef GRAPHICS_VIEW_H
    2 #define GRAPHICS_VIEW_H
    3 
    4 /*
    5 	graphics viewport definitions
    6 
    7 	Copyright © 2002 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #define ECS_SPECIFIC
   11 
   12 #ifndef EXEC_TYPES_H
   13 # include <exec/types.h>
   14 #endif
   15 
   16 #ifndef EXEC_SEMAPHORES_H
   17 # include <exec/semaphores.h>
   18 #endif
   19 
   20 #ifndef GRAPHICS_GFX_H
   21 # include <graphics/gfx.h>
   22 #endif
   23 
   24 #ifndef GRAPHICS_COPPER_H
   25 # include <graphics/copper.h>
   26 #endif
   27 
   28 #ifndef GRAPHICS_GFXNODES_H
   29 # include <graphics/gfxnodes.h>
   30 #endif
   31 
   32 #ifndef GRAPHICS_MONITOR_H
   33 # include <graphics/monitor.h>
   34 #endif
   35 
   36 #ifndef GRAPHICS_DISPLAYINFO_H
   37 # include <graphics/displayinfo.h>
   38 #endif
   39 
   40 #ifndef HARDWARE_CUSTOM_H
   41 # include <hardware/custom.h>
   42 #endif
   43 
   44 #pragma pack(2)
   45 
   46 
   47 struct ViewPort
   48 {
   49 	struct ViewPort *Next;
   50 	struct ColorMap *ColorMap;
   51 	struct CopList  *DspIns;
   52 	struct CopList  *SprIns;
   53 	struct CopList  *ClrIns;
   54 	struct UCopList *UCopIns;
   55 	WORD             DWidth, DHeight;
   56 	WORD             DxOffset, DyOffset;
   57 	UWORD            Modes;
   58 	UBYTE            SpritePriorities;
   59 	UBYTE            ExtendedModes;
   60 	struct RasInfo  *RasInfo;
   61 };
   62 
   63 struct View
   64 {
   65 	struct ViewPort *ViewPort;
   66 	struct cprlist  *LOFCprList;
   67 	struct cprlist  *SHFCprList;
   68 	WORD             DyOffset, DxOffset;
   69 	UWORD            Modes;
   70 };
   71 
   72 struct ViewExtra
   73 {
   74 	struct ExtendedNode  n;
   75 	struct View         *View;
   76 	struct MonitorSpec  *Monitor;
   77 	UWORD                TopLine;
   78 };
   79 
   80 struct ViewPortExtra
   81 {
   82 	struct ExtendedNode  n;
   83 	struct ViewPort     *ViewPort;
   84 	struct Rectangle     DisplayClip;
   85 
   86 	APTR                 VecTable;
   87 	APTR                 DriverData[2];
   88 	UWORD                Flags;
   89 	Point                Origin[2];
   90 	ULONG                cop1ptr;
   91 	ULONG                cop2ptr;
   92 };
   93 
   94 #define VPXB_FREE_ME        0
   95 #define VPXF_FREE_ME        (1<<VPXB_FREE_ME)
   96 #define VPXB_LAST           1
   97 #define VPXF_LAST           (1<<VPXB_LAST)
   98 #define VPXB_STRADDLES_256  4
   99 #define VPXF_STRADDLES_256  (1<<VPXB_STRADDLES_256)
  100 #define VPXB_STRADDLES_512  5
  101 #define VPXF_STRADDLES_512  (1<<VPXB_STRADDLES_512)
  102 
  103 
  104 #define EXTEND_VSTRUCT  0x1000
  105 
  106 #define VPF_A2024  0x40
  107 #define VPF_TENHZ  0x20
  108 #define VPB_A2024  6
  109 #define VPB_TENHZ  4
  110 
  111 
  112 #define GENLOCK_VIDEO    0x0002
  113 #define LACE             0x0004
  114 #define DOUBLESCAN       0x0008
  115 #define SUPERHIRES       0x0020
  116 #define PFBA             0x0040
  117 #define EXTRA_HALFBRITE  0x0080
  118 #define GENLOCK_AUDIO    0x0100
  119 #define DUALPF           0x0400
  120 #define HAM              0x0800
  121 #define EXTENDED_MODE    0x1000
  122 #define VP_HIDE          0x2000
  123 #define SPRITES          0x4000
  124 #define HIRES            0x8000
  125 
  126 struct RasInfo
  127 {
  128 	struct RasInfo *Next;
  129 	struct BitMap  *BitMap;
  130 	WORD            RxOffset, RyOffset;
  131 };
  132 
  133 struct ColorMap
  134 {
  135 	UBYTE                 Flags;
  136 	UBYTE                 Type;
  137 	UWORD                 Count;
  138 	APTR                  ColorTable;
  139 	struct ViewPortExtra *cm_vpe;
  140 	APTR                  LowColorBits;
  141 	UBYTE                 TransparencyPlane;
  142 	UBYTE                 SpriteResolution;
  143 	UBYTE                 SpriteResDefault;
  144 	UBYTE                 AuxFlags;
  145 	struct ViewPort      *cm_vp;
  146 	APTR                  NormalDisplayInfo;
  147 	APTR                  CoerceDisplayInfo;
  148 	struct TagItem       *cm_batch_items;
  149 	ULONG                 VPModeID;
  150 	struct PaletteExtra  *PalExtra;
  151 	UWORD                 SpriteBase_Even;
  152 	UWORD                 SpriteBase_Odd;
  153 	UWORD                 Bp_0_base;
  154 	UWORD                 Bp_1_base;
  155 };
  156 
  157 
  158 #define COLORMAP_TYPE_V1_2  0x00
  159 #define COLORMAP_TYPE_V1_4  0x01
  160 #define COLORMAP_TYPE_V36   COLORMAP_TYPE_V1_4
  161 #define COLORMAP_TYPE_V39   0x02
  162 
  163 #define COLORMAP_TRANSPARENCY    0x01
  164 #define COLORPLANE_TRANSPARENCY  0x02
  165 #define BORDER_BLANKING          0x04
  166 #define BORDER_NOTRANSPARENCY    0x08
  167 #define VIDEOCONTROL_BATCH       0x10
  168 #define USER_COPPER_CLIP         0x20
  169 #define BORDERSPRITES            0x40
  170 
  171 #define CMF_CMTRANS   0
  172 #define CMF_CPTRANS   1
  173 #define CMF_BRDRBLNK  2
  174 #define CMF_BRDNTRAN  3
  175 #define CMF_BRDRSPRT  6
  176 
  177 #define SPRITERESN_ECS       0
  178 #define SPRITERESN_140NS     1
  179 #define SPRITERESN_70NS      2
  180 #define SPRITERESN_35NS      3
  181 #define SPRITERESN_DEFAULT  -1
  182 
  183 #define CMAB_FULLPALETTE         0
  184 #define CMAF_FULLPALETTE         (1<<CMAB_FULLPALETTE)
  185 #define CMAB_NO_INTERMED_UPDATE  1
  186 #define CMAF_NO_INTERMED_UPDATE  (1<<CMAB_NO_INTERMED_UPDATE)
  187 #define CMAB_NO_COLOR_LOAD       2
  188 #define CMAF_NO_COLOR_LOAD       (1<<CMAB_NO_COLOR_LOAD)
  189 #define CMAB_DUALPF_DISABLE      3
  190 #define CMAF_DUALPF_DISABLE      (1<<CMAB_DUALPF_DISABLE)
  191 
  192 
  193 struct PaletteExtra
  194 {
  195 	struct SignalSemaphore  pe_Semaphore;
  196 	UWORD                   pe_FirstFree;
  197 	UWORD                   pe_NFree;
  198 	UWORD                   pe_FirstShared;
  199 	UWORD                   pe_NShared;
  200 	UBYTE                  *pe_RefCnt;
  201 	UBYTE                  *pe_AllocList;
  202 	struct ViewPort        *pe_ViewPort;
  203 	UWORD                   pe_SharableColors;
  204 };
  205 
  206 
  207 #define PENB_EXCLUSIVE    0
  208 #define PENB_NO_SETCOLOR  1
  209 
  210 #define PENF_EXCLUSIVE    (1<<PENB_EXCLUSIVE)
  211 #define PENF_NO_SETCOLOR  (1<<PENB_NO_SETCOLOR)
  212 
  213 #define PEN_EXCLUSIVE    PENF_EXCLUSIVE
  214 #define PEN_NO_SETCOLOR  PENF_NO_SETCOLOR
  215 
  216 
  217 #define PRECISION_EXACT  -1
  218 #define PRECISION_IMAGE   0
  219 #define PRECISION_ICON    16
  220 #define PRECISION_GUI     32
  221 
  222 
  223 #define OBP_Precision  0x84000000
  224 #define OBP_FailIfBad  0x84000001
  225 
  226 
  227 #define MVP_OK          0
  228 #define MVP_NO_MEM      1
  229 #define MVP_NO_VPE      2
  230 #define MVP_NO_DSPINS   3
  231 #define MVP_NO_DISPLAY  4
  232 #define MVP_OFF_BOTTOM  5
  233 
  234 
  235 #define MCOP_OK      0
  236 #define MCOP_NO_MEM  1
  237 #define MCOP_NOP     2
  238 
  239 
  240 struct DBufInfo
  241 {
  242 	APTR           dbi_Link1;
  243 	ULONG          dbi_Count1;
  244 	struct Message dbi_SafeMessage;
  245 	APTR           dbi_UserData1;
  246 
  247 	APTR           dbi_Link2;
  248 	ULONG          dbi_Count2;
  249 	struct Message dbi_DispMessage;
  250 	APTR           dbi_UserData2;
  251 	ULONG          dbi_MatchLong;
  252 	APTR           dbi_CopPtr1;
  253 	APTR           dbi_CopPtr2;
  254 	APTR           dbi_CopPtr3;
  255 	UWORD          dbi_BeamPos1;
  256 	UWORD          dbi_BeamPos2;
  257 };
  258 
  259 
  260 #pragma pack()
  261 
  262 #endif /* GRAPHICS_VIEW_H */