1 #ifndef GRAPHICS_VIEW_H
2 #define GRAPHICS_VIEW_H
5 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
12 #ifndef EXEC_SEMAPHORES_H
13 # include <exec/semaphores.h>
16 # include <exec/types.h>
18 #ifndef GRAPHICS_COPPER_H
19 # include <graphics/copper.h>
21 #ifndef GRAPHICS_DISPLAYINFO_H
22 # include <graphics/displayinfo.h>
24 #ifndef GRAPHICS_GFX_H
25 # include <graphics/gfx.h>
27 #ifndef GRAPHICS_GFXNODE_H
28 # include <graphics/gfxnodes.h>
30 #ifndef GRAPHICS_MONITOR_H
31 # include <graphics/monitor.h>
33 #ifndef HARDWARE_CUSTOM_H
34 # include <hardware/custom.h>
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)
50 struct ViewPort
* ViewPort
; /* Pointer to a first ViewPort */
51 struct cprlist
* LOFCprList
; /* Actual display copperlists (only for Amiga chipset) */
52 struct cprlist
* SHFCprList
;
57 UWORD Modes
; /* See below */
62 * Additional data for Amiga(tm) chipset. Not used by other hardware.
67 struct ExtendedNode n
; /* Common header */
69 struct View
* View
; /* View it relates to */
70 struct MonitorSpec
* Monitor
; /* Monitor used for displaying this View */
76 * Describes a displayed bitmap (or logical screen).
78 * Copperlists are relevant only to Amiga(tm) chipset, for other hardware they are NULL.
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 */
96 UWORD Modes
; /* The same as in View */
98 UBYTE SpritePriorities
;
101 struct RasInfo
* RasInfo
; /* Playfield specification */
104 /* *** ViewPortExtra ***
106 * Holds additional information about the ViewPort it is associated with
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 */
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
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.
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).
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
;
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
;
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 */
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)
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
211 * Describes playfield(s) (actually bitmaps)
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)
226 #define DOUBLESCAN (1<<3)
227 #define SUPERHIRES (1<<5)
229 #define EXTRA_HALFBRITE (1<<7)
230 #define GENLOCK_AUDIO (1<<8)
231 #define DUALPF (1<<10)
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 */
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)
250 #define VPF_TENHZ (1<<4)
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)
268 struct SignalSemaphore pe_Semaphore
;
271 UWORD pe_FirstShared
;
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
300 #define MVP_NO_DSPINS 3
301 #define MVP_NO_DISPLAY 4
302 #define MVP_OFF_BOTTOM 5
305 #define MCOP_NO_MEM 1
311 struct Message dbi_SafeMessage
;
316 struct Message dbi_DispMessage
;
326 #endif /* GRAPHICS_VIEW_H */