revert between 56095 -> 55830 in arch
[AROS.git] / compiler / include / graphics / view.h
bloba74aaec29bb07fa686d2c49a1ecff278d06b5af9
1 #ifndef GRAPHICS_VIEW_H
2 #define GRAPHICS_VIEW_H
4 /*
5 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: View structures
9 Lang: english
12 #ifndef EXEC_SEMAPHORES_H
13 # include <exec/semaphores.h>
14 #endif
15 #ifndef EXEC_TYPES_H
16 # include <exec/types.h>
17 #endif
18 #ifndef GRAPHICS_COPPER_H
19 # include <graphics/copper.h>
20 #endif
21 #ifndef GRAPHICS_DISPLAYINFO_H
22 # include <graphics/displayinfo.h>
23 #endif
24 #ifndef GRAPHICS_GFX_H
25 # include <graphics/gfx.h>
26 #endif
27 #ifndef GRAPHICS_GFXNODE_H
28 # include <graphics/gfxnodes.h>
29 #endif
30 #ifndef GRAPHICS_MONITOR_H
31 # include <graphics/monitor.h>
32 #endif
33 #ifndef HARDWARE_CUSTOM_H
34 # include <hardware/custom.h>
35 #endif
37 /* *** View ***
39 * Describes a physical display. Holds actual copperlists for Amiga(tm) chipset
40 * and some metainformation.
42 * Since AROS is going to work with multiple physical displays, meaning of this
43 * structure is downgraded to a simple list of ViewPorts to display (there's only
44 * one View despite there can be sevaral monitors and different ViewPorts may be shown
45 * on different displays)
48 struct View
50 struct ViewPort * ViewPort; /* Pointer to a first ViewPort */
51 struct cprlist * LOFCprList; /* Actual display copperlists (only for Amiga chipset) */
52 struct cprlist * SHFCprList;
54 WORD DyOffset;
55 WORD DxOffset;
57 UWORD Modes; /* See below */
60 /* *** ViewExtra ***
62 * Additional data for Amiga(tm) chipset. Not used by other hardware.
65 struct ViewExtra
67 struct ExtendedNode n; /* Common header */
69 struct View * View; /* View it relates to */
70 struct MonitorSpec * Monitor; /* Monitor used for displaying this View */
71 UWORD TopLine;
74 /* *** ViewPort ***
76 * Describes a displayed bitmap (or logical screen).
78 * Copperlists are relevant only to Amiga(tm) chipset, for other hardware they are NULL.
82 struct ViewPort
84 struct ViewPort * Next; /* Pointer to a next ViewPort in the view (NULL for the last ViewPort) */
86 struct ColorMap * ColorMap; /* Points to a ColorMap */
87 struct CopList * DspIns; /* Preliminary partial display copperlist */
88 struct CopList * SprIns; /* Preliminary partial sprite copperlist */
89 struct CopList * ClrIns;
90 struct UCopList * UCopIns; /* User-defined part of the copperlist */
92 WORD DWidth; /* Width of currently displayed part in pixels */
93 WORD DHeight; /* Height of currently displayed part in pixels */
94 WORD DxOffset; /* Displacement from the (0, 0) of the physical screen to (0, 0) of the raster */
95 WORD DyOffset;
96 UWORD Modes; /* The same as in View */
98 UBYTE SpritePriorities;
99 UBYTE ExtendedModes;
101 struct RasInfo * RasInfo; /* Playfield specification */
104 /* *** ViewPortExtra ***
106 * Holds additional information about the ViewPort it is associated with
109 struct ViewPortExtra
111 struct ExtendedNode n; /* Common header */
113 struct ViewPort * ViewPort; /* ViewPort it relates to */
114 struct Rectangle DisplayClip; /* Total size of displayable part */
116 APTR VecTable; /* Unused by AROS */
117 APTR DriverData[2]; /* Private storage for display drivers. Do not touch! */
118 UWORD Flags; /* Flags, see below */
119 Point Origin[2];
120 ULONG cop1ptr;
121 ULONG cop2ptr;
124 /* *** ColorMap ***
126 * This structure is the primary storage for palette data.
128 * Color data itself is stored in two tables: ColorTable and LowColorBits.
129 * These fields are actually pointer to arrays of UWORDs. Each UWORD corresponds
130 * to one color.
131 * Number of UWORDs in these arrays is equal to Count value in this structure.
132 * ColorTable stores upper nibbles of RGB values, LowColorBits stores low nibbles.
134 * Example:
135 * color number 4, value: 0x00ABCDEF
136 * ColorTable [4] = 0x0ACE,
137 * LowColorBits[4] = 0x0BDF
139 * SpriteBase fields keep bank number, not a color number. On m68k Amiga colors are divided into
140 * banks, 16 per each. So bank number is color number divided by 16. Base color is a number which
141 * is added to all colors of the sprite in order to look up the actual palette entry.
142 * AROS may run on different hardware where sprites may have base colors that do not divide by 16.
143 * In order to cover this bank numbers have a form: ((c & 0x0F) << 8 ) | (c >> 4), where c is actual
144 * color number (i. e. remainder is stored in a high byte of UWORD).
148 struct ColorMap
150 UBYTE Flags; /* see below */
151 UBYTE Type; /* Colormap type (reflects version), see below */
152 UWORD Count; /* Number of palette entries */
153 UWORD *ColorTable; /* Table of high nibbles of color values (see description above) */
155 /* The following fields are present only if Type >= COLORMAP_TYPE_V36 */
157 struct ViewPortExtra * cm_vpe; /* ViewPortExtra, for faster access */
159 UWORD *LowColorBits; /* Table of low nibbles of color values (see above) */
160 UBYTE TransparencyPlane;
161 UBYTE SpriteResolution; /* see below */
162 UBYTE SpriteResDefault;
163 UBYTE AuxFlags;
165 struct ViewPort * cm_vp; /* Points back to a ViewPort this colormap belongs to */
167 APTR NormalDisplayInfo;
168 APTR CoerceDisplayInfo;
170 struct TagItem * cm_batch_items;
171 ULONG VPModeID;
173 /* The following fields are present only if Type >= COLORMAP_TYPE_V39 */
175 struct PaletteExtra * PalExtra; /* Structure controlling palette sharing */
177 UWORD SpriteBase_Even; /* Color bank for even sprites (see above) */
178 UWORD SpriteBase_Odd; /* The same for odd sprites */
179 UWORD Bp_0_base;
180 UWORD Bp_1_base;
183 /* Flags */
184 #define CMF_CMTRANS 0
185 #define COLORMAP_TRANSPARENCY (1<<0)
186 #define CMF_CPTRANS 1
187 #define COLORPLANE_TRANSPARENCY (1<<1)
188 #define CMF_BRDRBLNK 2
189 #define BORDER_BLANKING (1<<2)
190 #define CMF_BRDNTRAN 3
191 #define BORDER_NOTRANSPARENCY (1<<3)
192 #define VIDEOCONTROL_BATCH (1<<4)
193 #define USER_COPPER_CLIP (1<<5)
194 #define CMF_BRDRSPRT 6
195 #define BORDERSPRITES (1<<6)
197 /* Type */
198 #define COLORMAP_TYPE_V1_2 0
199 #define COLORMAP_TYPE_V36 1
200 #define COLORMAP_TYPE_V39 2
202 /* SpriteResolution */
203 #define SPRITERESN_ECS 0x00
204 #define SPRITERESN_140NS 0x01
205 #define SPRITERESN_70NS 0x02
206 #define SPRITERESN_35NS 0x03
207 #define SPRITERESN_DEFAULT 0xFF
209 /* *** RasInfo ***
211 * Describes playfield(s) (actually bitmaps)
214 struct RasInfo
216 struct RasInfo * Next; /* Pointer to a next playfield (if there's more than one) */
217 struct BitMap * BitMap; /* Actual data to display */
219 WORD RxOffset; /* Offset of the playfield relative to ViewPort */
220 WORD RyOffset; /* (So that different playfields may be shifted against each other) */
223 /* Modes for ViewPort and View */
224 #define GENLOCK_VIDEO (1<<1)
225 #define LACE (1<<2)
226 #define DOUBLESCAN (1<<3)
227 #define SUPERHIRES (1<<5)
228 #define PFBA (1<<6)
229 #define EXTRA_HALFBRITE (1<<7)
230 #define GENLOCK_AUDIO (1<<8)
231 #define DUALPF (1<<10)
232 #define HAM (1<<11)
233 #define EXTENDED_MODE (1<<12)
234 #define VP_HIDE (1<<13)
235 #define SPRITES (1<<14)
236 #define HIRES (1<<15)
238 /* ViewPortExtra Flags */
239 #define VPXB_FREE_ME 0 /* Temporary ViewPortExtra allocated during MakeVPort(). ViewPortExtra with this flag */
240 #define VPXF_FREE_ME (1<<0) /* will be automatically found and disposed during FreeVPortCopLists(). Private flag in fact, don't set it by hands */
241 #define VPXB_LAST 1
242 #define VPXF_LAST (1<<1)
243 #define VPXB_STRADDLES256 4
244 #define VPXF_STRADDLES256 (1<<4)
245 #define VPXB_STRADDLES512 5
246 #define VPXF_STRADDLES512 (1<<5)
248 /* PRIVATE */
249 #define VPB_TENHZ 4
250 #define VPF_TENHZ (1<<4)
251 #define VPB_A2024 6
252 #define VPF_A2024 (1<<6)
254 #define EXTEND_VSTRUCT 0x1000
256 #define CMAB_FULLPALETTE 0
257 #define CMAF_FULLPALETTE (1<<CMAB_FULLPALETTE)
258 #define CMAB_NO_INTERMED_UPDATE 1
259 #define CMAF_NO_INTERMED_UPDATE (1<<CMAB_NO_INTERMED_UPDATE)
260 #define CMAB_NO_COLOR_LOAD 2
261 #define CMAF_NO_COLOR_LOAD (1 << CMAB_NO_COLOR_LOAD)
262 #define CMAB_DUALPF_DISABLE 3
263 #define CMAF_DUALPF_DISABLE (1 << CMAB_DUALPF_DISABLE)
266 struct PaletteExtra
268 struct SignalSemaphore pe_Semaphore;
269 UWORD pe_FirstFree;
270 UWORD pe_NFree;
271 UWORD pe_FirstShared;
272 UWORD pe_NShared;
273 UBYTE *pe_RefCnt;
274 UBYTE *pe_AllocList;
275 struct ViewPort *pe_ViewPort;
276 UWORD pe_SharableColors;
279 #define PENF_EXCLUSIVE (1l<<PENB_EXCLUSIVE)
280 #define PENF_NO_SETCOLOR (1l<<PENB_NO_SETCOLOR)
281 #define PENB_EXCLUSIVE 0
282 #define PENB_NO_SETCOLOR 1
285 #define PEN_EXCLUSIVE PENF_EXCLUSIVE
286 #define PEN_NO_SETCOLOR PENF_NO_SETCOLOR
288 #define PRECISION_EXACT -1
289 #define PRECISION_IMAGE 0
290 #define PRECISION_ICON 16
291 #define PRECISION_GUI 32
294 #define OBP_Precision 0x84000000
295 #define OBP_FailIfBad 0x84000001
297 #define MVP_OK 0
298 #define MVP_NO_MEM 1
299 #define MVP_NO_VPE 2
300 #define MVP_NO_DSPINS 3
301 #define MVP_NO_DISPLAY 4
302 #define MVP_OFF_BOTTOM 5
304 #define MCOP_OK 0
305 #define MCOP_NO_MEM 1
306 #define MCOP_NOP 2
308 struct DBufInfo {
309 APTR dbi_Link1;
310 ULONG dbi_Count1;
311 struct Message dbi_SafeMessage;
312 APTR dbi_UserData1;
314 APTR dbi_Link2;
315 ULONG dbi_Count2;
316 struct Message dbi_DispMessage;
317 APTR dbi_UserData2;
318 ULONG dbi_MatchLong;
319 APTR dbi_CopPtr1;
320 APTR dbi_CopPtr2;
321 APTR dbi_CopPtr3;
322 UWORD dbi_BeamPos1;
323 UWORD dbi_BeamPos2;
326 #endif /* GRAPHICS_VIEW_H */