]> git.sesse.net Git - pistorm/blob - platforms/amiga/rtg/rtg_driver_amiga/boardinfo.h
Add license information to source
[pistorm] / platforms / amiga / rtg / rtg_driver_amiga / boardinfo.h
1 // SPDX-License-Identifier: MIT
2
3 #ifndef boardinfo_H
4 #define boardinfo_H
5
6 #ifndef  LIBRARIES_PICASSO96_H
7 #include        <libraries/Picasso96.h>
8 #endif
9
10 #ifndef  EXEC_INTERRUPTS_H
11 #include        <exec/interrupts.h>
12 #endif
13
14 #ifndef  EXEC_LIBRARIES_H
15 #include <exec/libraries.h>
16 #endif
17
18 #ifndef  EXEC_SEMAPHORES_H
19 #include        <exec/semaphores.h>
20 #endif
21
22 #ifndef  GRAPHICS_GFX_H
23 #include        <graphics/gfx.h>
24 #endif
25
26 #ifndef  GRAPHICS_VIEW_H
27 #include        <graphics/view.h>
28 #endif
29
30 #ifndef DEVICES_TIMER_H
31 #include <devices/timer.h>
32 #endif
33
34 #ifndef settings_H
35 #include        "settings.h"
36 #endif
37
38 /* registerized parameters */
39
40 #ifdef __STORMGCC__
41   #define ASM
42 #else
43   #ifdef __GNUC__
44     #define ASM
45     #define __REGD0(x) x __asm("d0")
46     #define __REGD1(x) x __asm("d1")
47     #define __REGD2(x) x __asm("d2")
48     #define __REGD3(x) x __asm("d3")
49     #define __REGD4(x) x __asm("d4")
50     #define __REGD5(x) x __asm("d5")
51     #define __REGD6(x) x __asm("d6")
52     #define __REGD7(x) x __asm("d7")
53     #define __REGA0(x) x __asm("a0")
54     #define __REGA1(x) x __asm("a1")
55     #define __REGA2(x) x __asm("a2")
56     #define __REGA3(x) x __asm("a3")
57     #define __REGA4(x) x __asm("a4")
58     #define __REGA5(x) x __asm("a5")
59     #define __REGA6(x) x __asm("a6")
60     #define __REGA7(x) x __asm("a7")
61   #else
62     #define ASM 
63     #define __REGD0(x)  __reg("d0") x
64     #define __REGD1(x)  __reg("d1") x
65     #define __REGD2(x)  __reg("d2") x
66     #define __REGD3(x)  __reg("d3") x
67     #define __REGD4(x)  __reg("d4") x
68     #define __REGD5(x)  __reg("d5") x
69     #define __REGD6(x)  __reg("d6") x
70     #define __REGD7(x)  __reg("d7") x
71     #define __REGA0(x)  __reg("a0") x
72     #define __REGA1(x)  __reg("a1") x
73     #define __REGA2(x)  __reg("a2") x
74     #define __REGA3(x)  __reg("a3") x
75     #define __REGA4(x)  __reg("a4") x
76     #define __REGA5(x)  __reg("a5") x
77     #define __REGA6(x)  __reg("a6") x
78     #define __REGA7(x)  __reg("a7") x
79   #endif
80 #endif
81
82 /************************************************************************/
83
84 #define MAXSPRITEWIDTH 32
85 #define MAXSPRITEHEIGHT 48
86
87 /************************************************************************/
88
89 #define DI_P96_INVALID  0x1000
90 #define DI_P96_MONITOOL 0x2000
91
92 /************************************************************************/
93 /* Types for BoardType Identification
94  */
95 typedef enum {
96         BT_NoBoard,
97         BT_oMniBus,
98         BT_Graffity,
99         BT_CyberVision,
100         BT_Domino,
101         BT_Merlin,
102         BT_PicassoII,
103         BT_Piccolo,
104         BT_RetinaBLT,
105         BT_Spectrum,
106         BT_PicassoIV,
107         BT_PiccoloSD64,
108         BT_A2410,
109         BT_Pixel64,
110         BT_uaegfx,              // 14
111         BT_CVision3D,
112         BT_Altais,
113         BT_Prometheus,
114         BT_Mediator,
115         BT_powerfb,
116         BT_powerpci,
117         BT_CVisionPPC,
118         BT_GREX,
119         BT_Prototype7,
120         BT_Reserved,
121         BT_Reserved2,
122         BT_MNT_VA2000,
123         BT_MNT_ZZ9000,
124         BT_MaxBoardTypes
125 } BTYPE;
126
127 /************************************************************************/
128 /* Types for PaletteChipType Identification
129  */
130 typedef enum {
131         PCT_Unknown,
132         PCT_S11483,                             // Sierra S11483: HiColor 15 bit, oMniBus, Domino
133         PCT_S15025,                             // Sierra S15025: TrueColor 32 bit, oMniBus
134         PCT_CirrusGD542x,               // Cirrus GD542x internal: TrueColor 24 bit
135         PCT_Domino,                             // is in fact a Sierra S11483
136         PCT_BT482,                              // BrookTree BT482: TrueColor 32 bit, Merlin
137         PCT_Music,                              // Music MU9C4910: TrueColor 24 bit, oMniBus
138         PCT_ICS5300,                    // ICS 5300: ...., Retina BLT Z3
139         PCT_CirrusGD5446,               // Cirrus GD5446 internal: TrueColor 24 bit
140         PCT_CirrusGD5434,               // Cirrus GD5434 internal: TrueColor 32 bit
141         PCT_S3Trio64,                   // S3 Trio64 internal: TrueColor 32 bit
142         PCT_A2410_xxx,                  // A2410 DAC, *type unknown*
143         PCT_S3ViRGE,                    // S3 ViRGE internal: TrueColor 32 bit
144         PCT_3dfxVoodoo,         // 3dfx Voodoo internal
145         PCT_TIPermedia2,                // TexasInstruments TVP4020 Permedia2 internal
146         PCT_ATIRV100,                   // ATI Technologies Radeon/Radeon 7000 internal
147         PCT_reserved,
148         PCT_reserved2,
149         PCT_MNT_VA2000,
150         PCT_MNT_ZZ9000,
151         PCT_MaxPaletteChipTypes
152 } PCTYPE;
153
154 /************************************************************************/
155 /* Types for GraphicsControllerType Identification
156  */
157 typedef enum {
158         GCT_Unknown,
159         GCT_ET4000,
160         GCT_ETW32,      
161         GCT_CirrusGD542x,
162         GCT_NCR77C32BLT,        
163         GCT_CirrusGD5446,
164         GCT_CirrusGD5434,
165         GCT_S3Trio64,
166         GCT_TI34010,
167         GCT_S3ViRGE,
168         GCT_3dfxVoodoo,
169         GCT_TIPermedia2,
170         GCT_ATIRV100,
171         GCT_reserved,
172         GCT_reserved2,
173         GCT_MNT_VA2000,
174         GCT_MNT_ZZ9000,
175         GCT_MaxGraphicsControllerTypes
176 } GCTYPE;
177
178 /************************************************************************/
179
180 #define RGBFF_PLANAR    RGBFF_NONE
181 #define RGBFF_CHUNKY    RGBFF_CLUT
182
183 #define RGBFB_PLANAR    RGBFB_NONE
184 #define RGBFB_CHUNKY    RGBFB_CLUT
185
186 /************************************************************************/
187
188 enum{
189         DPMS_ON,                        /* Full operation                             */
190         DPMS_STANDBY,   /* Optional state of minimal power reduction  */
191         DPMS_SUSPEND,   /* Significant reduction of power consumption */
192         DPMS_OFF                        /* Lowest level of power consumption          */
193 };
194
195 /************************************************************************/
196
197 struct CLUTEntry {
198         UBYTE   Red;
199         UBYTE   Green;
200         UBYTE   Blue;
201 };
202
203 struct ColorIndexMapping {
204         ULONG   ColorMask;
205         ULONG   Colors[256];
206 };
207
208 /************************************************************************/
209
210 struct GfxMemChunk {
211         struct MinNode Node;
212         char *Ptr;
213         ULONG Size;
214         BOOL Used;
215 };
216
217 /************************************************************************/
218
219 struct Template {
220         APTR                    Memory;
221         WORD                    BytesPerRow;
222         UBYTE                   XOffset;                                // 0 <= XOffset <= 15
223         UBYTE                   DrawMode;
224         ULONG                   FgPen;
225         ULONG                   BgPen;
226 };
227
228 /************************************************************************/
229
230 struct Pattern {
231         APTR                    Memory;
232         UWORD                   XOffset, YOffset;
233         ULONG                   FgPen, BgPen;
234         UBYTE                   Size;                                   // Width: 16, Height: (1<<pat_Size)
235         UBYTE                   DrawMode;
236 };
237
238 /************************************************************************/
239
240 struct Line {
241         WORD                    X, Y;
242         UWORD                   Length;
243         WORD                    dX, dY;
244         WORD                    sDelta, lDelta, twoSDminusLD;
245         UWORD                   LinePtrn;
246         UWORD                   PatternShift;
247         ULONG                   FgPen, BgPen;
248         BOOL                    Horizontal;
249         UBYTE                   DrawMode;
250         BYTE                    pad;
251         UWORD                   Xorigin, Yorigin;
252 };
253
254 /************************************************************************/
255
256 struct BitMapExtra {
257         struct MinNode                  BoardNode;
258         struct BitMapExtra      *HashChain;
259         APTR                                            Match;
260         struct BitMap                   *BitMap;
261         struct BoardInfo                *BoardInfo;
262         APTR                                            MemChunk;
263         struct RenderInfo               RenderInfo;
264         UWORD                                           Width, Height;
265         UWORD                                           Flags;
266         // NEW !!!
267         WORD                                            BaseLevel, CurrentLevel;
268         struct BitMapExtra      *CompanionMaster;
269 };
270
271 /* BitMapExtra flags */
272 #define BMEF_ONBOARD                    0x0001
273 #define BMEF_SPECIAL                    0x0002
274 #define  BMEF_VISIBLE                   0x0800
275 #define  BMEF_DISPLAYABLE               0x1000
276 #define BMEF_SPRITESAVED                0x2000
277 #define BMEF_CHECKSPRITE                0x4000
278 #define BMEF_INUSE                              0x8000
279
280 /************************************************************************/
281
282 struct SpecialFeature {
283         struct MinNode          Node;
284         struct BoardInfo        *BoardInfo;
285         struct BitMap           *BitMap;
286         ULONG                                   Type;
287         APTR                                    FeatureData;
288 };
289
290 enum  {
291         SFT_INVALID, SFT_FLICKERFIXER, SFT_VIDEOCAPTURE, SFT_VIDEOWINDOW, SFT_MEMORYWINDOW
292 };
293
294 #define FA_Restore                                      (TAG_USER+0)                    /* becomes visible again */
295 #define FA_Onboard                                      (TAG_USER+1)
296 #define FA_Active                                       (TAG_USER+2)
297 #define FA_Left                                         (TAG_USER+3)
298 #define FA_Top                                          (TAG_USER+4)
299 #define FA_Width                                                (TAG_USER+5)
300 #define FA_Height                                       (TAG_USER+6)
301 #define FA_Format                                       (TAG_USER+7)
302 #define FA_Color                                                (TAG_USER+8)
303 #define FA_Occlusion                            (TAG_USER+9)
304 #define FA_SourceWidth                          (TAG_USER+10)
305 #define FA_SourceHeight                 (TAG_USER+11)
306 #define FA_MinWidth                                     (TAG_USER+12)
307 #define FA_MinHeight                            (TAG_USER+13)
308 #define FA_MaxWidth                                     (TAG_USER+14)
309 #define FA_MaxHeight                            (TAG_USER+15)
310 #define FA_Interlace                            (TAG_USER+16)
311 #define FA_PAL                                          (TAG_USER+17)
312 #define FA_BitMap                                       (TAG_USER+18)
313 #define FA_Brightness                           (TAG_USER+19)
314 #define FA_ModeInfo                                     (TAG_USER+20)
315 #define FA_ModeFormat                           (TAG_USER+21)
316 #define FA_Colors                                       (TAG_USER+22)
317 #define FA_Colors32                                     (TAG_USER+23)
318 #define FA_NoMemory                                     (TAG_USER+24)
319 #define FA_RenderFunc                           (TAG_USER+25)
320 #define FA_SaveFunc                                     (TAG_USER+26)
321 #define FA_UserData                                     (TAG_USER+27)
322 #define FA_Alignment                            (TAG_USER+28)
323 #define FA_ConstantBytesPerRow  (TAG_USER+29)
324 #define FA_DoubleBuffer                 (TAG_USER+30)
325 #define FA_Pen                                          (TAG_USER+31)
326 #define FA_ModeMemorySize                       (TAG_USER+32)
327 #define FA_ClipLeft                                     (TAG_USER+33)
328 #define FA_ClipTop                                      (TAG_USER+34)
329 #define FA_ClipWidth                            (TAG_USER+35)
330 #define FA_ClipHeight                           (TAG_USER+36)
331 #define FA_ConstantByteSwapping (TAG_USER+37)
332
333 /************************************************************************/
334
335 /* Tags for bi->AllocBitMap() */
336
337 #define ABMA_Friend                                             (TAG_USER+0)
338 #define ABMA_Depth                                              (TAG_USER+1)
339 #define ABMA_RGBFormat                                  (TAG_USER+2)
340 #define ABMA_Clear                                              (TAG_USER+3)
341 #define ABMA_Displayable                                (TAG_USER+4)
342 #define ABMA_Visible                                    (TAG_USER+5)
343 #define ABMA_NoMemory                                   (TAG_USER+6)
344 #define ABMA_NoSprite                                   (TAG_USER+7)
345 #define ABMA_Colors                                             (TAG_USER+8)
346 #define ABMA_Colors32                                   (TAG_USER+9)
347 #define ABMA_ModeWidth                                  (TAG_USER+10)
348 #define ABMA_ModeHeight                         (TAG_USER+11)
349 #define ABMA_RenderFunc                         (TAG_USER+12)
350 #define ABMA_SaveFunc                                   (TAG_USER+13)
351 #define ABMA_UserData                                   (TAG_USER+14)
352 #define ABMA_Alignment                          (TAG_USER+15)
353 #define ABMA_ConstantBytesPerRow        (TAG_USER+16)
354 #define ABMA_UserPrivate                                (TAG_USER+17)
355 #define ABMA_ConstantByteSwapping       (TAG_USER+18)
356 /*
357  * THOR: New for V45 Gfx/Intuiton
358  * "by accident", this is identically to SA_DisplayID of intuition
359  * resp. SA_Behind, SA_Colors, SA_Colors32
360  */
361 #define ABMA_DisplayID                  (TAG_USER + 32 + 0x12)
362 #define ABMA_BitmapInvisible            (TAG_USER + 32 + 0x17)
363 #define ABMA_BitmapColors               (TAG_USER + 32 + 0x09)
364 #define ABMA_BitmapColors32             (TAG_USER + 32 + 0x23)
365
366 /************************************************************************/
367
368 /* Tags for bi->GetBitMapAttr() */
369
370 #define GBMA_MEMORY                             (TAG_USER+0)
371 #define GBMA_BASEMEMORY         (TAG_USER+1)
372 #define GBMA_BYTESPERROW                (TAG_USER+2)
373 #define GBMA_BYTESPERPIXEL      (TAG_USER+3)
374 #define GBMA_BITSPERPIXEL               (TAG_USER+4)
375 #define GBMA_RGBFORMAT                  (TAG_USER+6)
376 #define GBMA_WIDTH                              (TAG_USER+7)
377 #define GBMA_HEIGHT                             (TAG_USER+8)
378 #define GBMA_DEPTH                              (TAG_USER+9)
379
380 /************************************************************************/
381
382 struct BoardInfo{
383         UBYTE                                                           *RegisterBase, *MemoryBase, *MemoryIOBase;
384         ULONG                                                                   MemorySize;
385         char                                                                    *BoardName,VBIName[32];
386         struct CardBase                                 *CardBase;
387         struct ChipBase                                 *ChipBase;
388         struct ExecBase                                 *ExecBase;
389         struct Library                                          *UtilBase;
390         struct Interrupt                                        HardInterrupt;
391         struct Interrupt                                        SoftInterrupt;
392         struct SignalSemaphore                  BoardLock;
393         struct MinList                                          ResolutionsList;
394         BTYPE                                                                   BoardType;
395         PCTYPE                                                          PaletteChipType;
396         GCTYPE                                                          GraphicsControllerType;
397         UWORD                                                                   MoniSwitch;
398         UWORD                                                                   BitsPerCannon;
399         ULONG                                                                   Flags;
400         UWORD                                                                   SoftSpriteFlags;
401         UWORD                                                                   ChipFlags;                                      // private, chip specific, not touched by RTG
402         ULONG                                                                   CardFlags;                                      // private, card specific, not touched by RTG
403
404         UWORD                                                                   BoardNum;                                       // set by rtg.library
405         UWORD                                                                   RGBFormats;
406
407         UWORD                                                                   MaxHorValue[MAXMODES];
408         UWORD                                                                   MaxVerValue[MAXMODES];
409         UWORD                                                                   MaxHorResolution[MAXMODES];
410         UWORD                                                                   MaxVerResolution[MAXMODES];
411         ULONG                                                                   MaxMemorySize, MaxChunkSize;
412
413         ULONG                                                                   MemoryClock;
414
415         ULONG                                                                   PixelClockCount[MAXMODES];
416
417         APTR ASM                                                        (*AllocCardMem)(__REGA0(struct BoardInfo *bi), __REGD0(ULONG size), __REGD1(BOOL force), __REGD2(BOOL system));
418         BOOL ASM                                                        (*FreeCardMem)(__REGA0(struct BoardInfo *bi), __REGA1(APTR membase));
419
420         BOOL ASM                                                        (*SetSwitch)(__REGA0(struct BoardInfo *), __REGD0(BOOL));
421
422         void ASM                                                        (*SetColorArray)(__REGA0(struct BoardInfo *), __REGD0(UWORD), __REGD1(UWORD));
423
424         void ASM                                                        (*SetDAC)(__REGA0(struct BoardInfo *), __REGD7(RGBFTYPE));
425         void ASM                                                        (*SetGC)(__REGA0(struct BoardInfo *), __REGA1(struct ModeInfo *), __REGD0(BOOL));
426         void ASM                                                        (*SetPanning)(__REGA0(struct BoardInfo *), __REGA1(UBYTE *), __REGD0(UWORD), __REGD1(WORD), __REGD2(WORD), __REGD7(RGBFTYPE));
427         UWORD ASM                                                       (*CalculateBytesPerRow)(__REGA0(struct BoardInfo *), __REGD0(UWORD), __REGD7(RGBFTYPE));
428         APTR ASM                                                        (*CalculateMemory)(__REGA0(struct BoardInfo *), __REGA1(APTR), __REGD7(RGBFTYPE));
429         ULONG ASM                                                       (*GetCompatibleFormats)(__REGA0(struct BoardInfo *), __REGD7(RGBFTYPE));
430         BOOL ASM                                                        (*SetDisplay)(__REGA0(struct BoardInfo *), __REGD0(BOOL));
431
432         LONG ASM                                                        (*ResolvePixelClock)(__REGA0(struct BoardInfo *), __REGA1(struct ModeInfo *), __REGD0(ULONG), __REGD7(RGBFTYPE));
433         ULONG   ASM                                                     (*GetPixelClock)(__REGA0(struct BoardInfo *bi), __REGA1(struct ModeInfo *), __REGD0(ULONG), __REGD7(RGBFTYPE));
434         void ASM                                                        (*SetClock)(__REGA0(struct BoardInfo *));
435
436         void ASM                                                        (*SetMemoryMode)(__REGA0(struct BoardInfo *), __REGD7(RGBFTYPE));
437         void ASM                                                        (*SetWriteMask)(__REGA0(struct BoardInfo *), __REGD0(UBYTE));
438         void ASM                                                        (*SetClearMask)(__REGA0(struct BoardInfo *), __REGD0(UBYTE));
439         void ASM                                                        (*SetReadPlane)(__REGA0(struct BoardInfo *), __REGD0(UBYTE));
440
441         void ASM                                                        (*WaitVerticalSync)(__REGA0(struct BoardInfo *), __REGD0(BOOL));
442         BOOL ASM                                                        (*SetInterrupt)(__REGA0(struct BoardInfo *), __REGD0(BOOL));
443
444         void ASM                                                        (*WaitBlitter)(__REGA0(struct BoardInfo *));
445
446         void ASM                                                        (*ScrollPlanar)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(UWORD), __REGD1(UWORD), __REGD2(UWORD), __REGD3(UWORD), __REGD4(UWORD), __REGD5(UWORD), __REGD6(UBYTE));
447         void ASM                                                        (*ScrollPlanarDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(UWORD), __REGD1(UWORD), __REGD2(UWORD), __REGD3(UWORD), __REGD4(UWORD), __REGD5(UWORD), __REGD6(UBYTE));
448         void ASM                                                        (*UpdatePlanar)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGA2(struct RenderInfo *), __REGD0(SHORT), __REGD1(SHORT), __REGD2(SHORT), __REGD3(SHORT), __REGD4(UBYTE));
449         void ASM                                                        (*UpdatePlanarDefault)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGA2(struct RenderInfo *), __REGD0(SHORT), __REGD1(SHORT), __REGD2(SHORT), __REGD3(SHORT), __REGD4(UBYTE));
450         void ASM                                                        (*BlitPlanar2Chunky)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGA2(struct RenderInfo *), __REGD0(SHORT), __REGD1(SHORT), __REGD2(SHORT), __REGD3(SHORT), __REGD4(SHORT), __REGD5(SHORT), __REGD6(UBYTE), __REGD7(UBYTE));
451         void ASM                                                        (*BlitPlanar2ChunkyDefault)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGA2(struct RenderInfo *), __REGD0(SHORT), __REGD1(SHORT), __REGD2(SHORT), __REGD3(SHORT), __REGD4(SHORT), __REGD5(SHORT), __REGD6(UBYTE), __REGD7(UBYTE));
452
453         void ASM                                                        (*FillRect)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(ULONG), __REGD5(UBYTE), __REGD7(RGBFTYPE));
454         void ASM                                                        (*FillRectDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(ULONG), __REGD5(UBYTE), __REGD7(RGBFTYPE));
455         void ASM                                                        (*InvertRect)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(UBYTE), __REGD7(RGBFTYPE));
456         void ASM                                                        (*InvertRectDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(UBYTE), __REGD7(RGBFTYPE));
457         void ASM                                                        (*BlitRect)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(WORD), __REGD5(WORD), __REGD6(UBYTE), __REGD7(RGBFTYPE));
458         void ASM                                                        (*BlitRectDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(WORD), __REGD5(WORD), __REGD6(UBYTE), __REGD7(RGBFTYPE));
459         void ASM                                                        (*BlitTemplate)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct Template *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(UBYTE), __REGD7(RGBFTYPE));
460         void ASM                                                        (*BlitTemplateDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct Template *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(UBYTE), __REGD7(RGBFTYPE));
461         void ASM                                                        (*BlitPattern)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct Pattern *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(UBYTE), __REGD7(RGBFTYPE));
462         void ASM                                                        (*BlitPatternDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct Pattern *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(UBYTE), __REGD7(RGBFTYPE));
463         void ASM                                                        (*DrawLine)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct Line *), __REGD0(UBYTE), __REGD7(RGBFTYPE));
464         void ASM                                                        (*DrawLineDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct Line *), __REGD0(UBYTE), __REGD7(RGBFTYPE));
465         void ASM                                                        (*BlitRectNoMaskComplete)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(WORD), __REGD5(WORD), __REGD6(UBYTE), __REGD7(RGBFTYPE));
466         void ASM                                                        (*BlitRectNoMaskCompleteDefault)(__REGA0(struct BoardInfo *), __REGA1(struct RenderInfo *), __REGA2(struct RenderInfo *), __REGD0(WORD), __REGD1(WORD), __REGD2(WORD), __REGD3(WORD), __REGD4(WORD), __REGD5(WORD), __REGD6(UBYTE), __REGD7(RGBFTYPE));
467         void ASM                                                        (*BlitPlanar2Direct)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGA2(struct RenderInfo *), __REGA3(struct ColorIndexMapping *), __REGD0(SHORT), __REGD1(SHORT), __REGD2(SHORT), __REGD3(SHORT), __REGD4(SHORT), __REGD5(SHORT), __REGD6(UBYTE), __REGD7(UBYTE));
468         void ASM                                                        (*BlitPlanar2DirectDefault)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGA2(struct RenderInfo *), __REGA3(struct ColorIndexMapping *), __REGD0(SHORT), __REGD1(SHORT), __REGD2(SHORT), __REGD3(SHORT), __REGD4(SHORT), __REGD5(SHORT), __REGD6(UBYTE), __REGD7(UBYTE));
469         BOOL ASM                                                        (*EnableSoftSprite)(__REGA0(struct BoardInfo *),__REGD0(ULONG formatflags),__REGA1(struct ModeInfo *));
470         BOOL ASM                                                        (*EnableSoftSpriteDefault)(__REGA0(struct BoardInfo *),__REGD0(ULONG formatflags),__REGA1(struct ModeInfo *));
471         APTR ASM                                                        (*AllocCardMemAbs)(__REGA0(struct BoardInfo *),__REGD0(ULONG size), __REGA1(char *target));
472         void ASM                                                        (*SetSplitPosition)(__REGA0(struct BoardInfo *),__REGD0(SHORT));
473         void ASM                                                        (*ReInitMemory)(__REGA0(struct BoardInfo *),__REGD0(RGBFTYPE));
474         void ASM                                                        (*Reserved2Default)(__REGA0(struct BoardInfo *));
475         void ASM                                                        (*Reserved3)(__REGA0(struct BoardInfo *));
476         void ASM                                                        (*Reserved3Default)(__REGA0(struct BoardInfo *));
477
478         int ASM                                                 (*WriteYUVRect)(__REGA0(struct BoardInfo *), __REGA1(APTR), __REGD0(SHORT), __REGD1(SHORT), __REGA2(struct RenderInfo *), __REGD2(SHORT), __REGD3(SHORT), __REGD4(SHORT), __REGD5(SHORT), __REGA3(struct TagItem *));
479         int ASM                                                 (*WriteYUVRectDefault)(__REGA0(struct BoardInfo *), __REGA1(APTR), __REGD0(SHORT), __REGD1(SHORT), __REGA2(struct RenderInfo *), __REGD2(SHORT), __REGD3(SHORT), __REGD4(SHORT), __REGD5(SHORT), __REGA3(struct TagItem *));
480
481         BOOL ASM                                                        (*GetVSyncState)(__REGA0(struct BoardInfo *), __REGD0(BOOL));
482         ULONG ASM                                                       (*GetVBeamPos)(__REGA0(struct BoardInfo *));
483         void ASM                                                        (*SetDPMSLevel)(__REGA0(struct BoardInfo *), __REGD0(ULONG));
484         void ASM                                                        (*ResetChip)(__REGA0(struct BoardInfo *));
485         ULONG ASM                                                       (*GetFeatureAttrs)(__REGA0(struct BoardInfo *), __REGA1(APTR), __REGD0(ULONG), __REGA2(struct TagItem *));
486
487         struct BitMap * ASM                     (*AllocBitMap)(__REGA0(struct BoardInfo *), __REGD0(ULONG), __REGD1(ULONG), __REGA1(struct TagItem *));
488         BOOL ASM                                                        (*FreeBitMap)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGA2(struct TagItem *));
489         ULONG ASM                                                       (*GetBitMapAttr)(__REGA0(struct BoardInfo *), __REGA1(struct BitMap *), __REGD0(ULONG));
490
491         BOOL ASM                                                        (*SetSprite)(__REGA0(struct BoardInfo *), __REGD0(BOOL), __REGD7(RGBFTYPE));
492         void ASM                                                        (*SetSpritePosition)(__REGA0(struct BoardInfo *), __REGD0(WORD), __REGD1(WORD), __REGD7(RGBFTYPE));
493         void ASM                                                        (*SetSpriteImage)(__REGA0(struct BoardInfo *), __REGD7(RGBFTYPE));
494         void ASM                                                        (*SetSpriteColor)(__REGA0(struct BoardInfo *), __REGD0(UBYTE), __REGD1(UBYTE), __REGD2(UBYTE), __REGD3(UBYTE), __REGD7(RGBFTYPE));
495
496         APTR ASM                                                        (*CreateFeature)(__REGA0(struct BoardInfo *), __REGD0(ULONG), __REGA1(struct TagItem *));
497         ULONG ASM                                                       (*SetFeatureAttrs)(__REGA0(struct BoardInfo *), __REGA1(APTR), __REGD0(ULONG), __REGA2(struct TagItem *));
498         BOOL ASM                                                        (*DeleteFeature)(__REGA0(struct BoardInfo *), __REGA1(APTR), __REGD0(ULONG));
499         struct MinList                                          SpecialFeatures;
500
501         struct ModeInfo                                 *ModeInfo;                                                              /* Chip Settings Stuff */
502         RGBFTYPE                                                                RGBFormat;
503         WORD                                                                    XOffset;
504         WORD                                                                    YOffset;
505         UBYTE                                                                   Depth;
506         UBYTE                                                                   ClearMask;
507         BOOL                                                                    Border;
508         ULONG                                                                   Mask;
509         struct CLUTEntry                                        CLUT[256];
510
511         struct ViewPort                                 *ViewPort;                                                              /* ViewPort Stuff */
512         struct BitMap                                           *VisibleBitMap;
513         struct BitMapExtra                              *BitMapExtra;
514         struct MinList                                          BitMapList;
515         struct MinList                                          MemList;
516
517         WORD                                                                    MouseX;
518         WORD                                                                    MouseY;                                         /* Sprite Stuff */
519         UBYTE                                                                   MouseWidth;
520         UBYTE                                                                   MouseHeight;
521         UBYTE                                                                   MouseXOffset;
522         UBYTE                                                                   MouseYOffset;
523         UWORD                                                                   *MouseImage;
524         UBYTE                                                                   MousePens[4];
525         struct Rectangle                                        MouseRect;
526         UBYTE                                                                   *MouseChunky;
527         UWORD                                                                   *MouseRendered;
528         UBYTE                                                                   *MouseSaveBuffer;
529
530         ULONG                                                                   ChipData[16];                                                   /* for chip driver needs */
531         ULONG                                                                   CardData[16];                                                   /* for card driver needs */
532
533         APTR                                                                    MemorySpaceBase;                                                /* the base address of the board memory address space */
534         ULONG                                                                   MemorySpaceSize;                                                /* size of that area */
535
536         APTR                                                                    DoubleBufferList;                                               /* chain of dbinfos being notified on vblanks */
537
538         struct timeval                                          SyncTime;                                                               /* system time when screen was set up, used for pseudo vblanks */
539         ULONG                                                                   SyncPeriod;                                                             /* length of one frame in micros */
540         struct MsgPort                                          SoftVBlankPort;                                         /* MsgPort for software emulation of board interrupt */
541
542         struct MinList                                          WaitQ;                                                                  /* for WaitTOF and WaitBOVP, all elements will be signaled on VBlank */
543         
544         LONG                                                                    EssentialFormats;                                               /* these RGBFormats will be used when user does not choose "all"
545                                                                                                                                                                                         will be filled by InitBoard() */
546         UBYTE                                                                   *MouseImageBuffer;                                      /* rendered to the destination color format */
547   /* Additional viewport stuff */
548         struct ViewPort    *backViewPort;     /* The view port visible on the screen behind */
549         struct BitMap      *backBitMap;       /* Its bitmap */
550         struct BitMapExtra *backExtra;        /* its bitmapExtra */
551         WORD                YSplit;
552         ULONG               MaxPlanarMemory;  /* Size of a bitplane if planar. If left blank, MemorySize>>2 */
553         ULONG               MaxBMWidth;       /* Maximum width of a bitmap */
554         ULONG               MaxBMHeight;      /* Maximum height of a bitmap */
555 };
556
557 /* BoardInfo flags */
558 /*  0-15: hardware flags */
559 /* 16-31: user flags */
560 #define BIB_HARDWARESPRITE                       0              /* board has hardware sprite */
561 #define BIB_NOMEMORYMODEMIX              1              /* board does not support modifying planar bitmaps while displaying chunky and vice versa */
562 #define BIB_NEEDSALIGNMENT                       2              /* bitmaps have to be aligned (not yet supported!) */
563 #define BIB_CACHEMODECHANGE              3              /* board memory may be set to Imprecise (060) or Nonserialised (040) */
564 #define BIB_VBLANKINTERRUPT              4              /* board can cause a hardware interrupt on a vertical retrace */
565 #define BIB_HASSPRITEBUFFER              5              /* board has allocated memory for software sprite image and save buffer */
566
567 #define BIB_VGASCREENSPLIT               6              /* has a screen B with fixed screen position for split-screens */
568
569 #define BIB_DBLSCANDBLSPRITEY            8              /* hardware sprite y position is doubled on doublescan display modes */
570 #define BIB_ILACEHALFSPRITEY             9              /* hardware sprite y position is halved on interlace display modes */
571 #define BIB_ILACEDBLROWOFFSET           10              /* doubled row offset in interlaced display modes needs additional horizontal bit */
572 #define BIB_INTERNALMODESONLY           11              /* board creates its resolutions and modes automatically and does not support user setting files (UAE) */
573 #define BIB_FLICKERFIXER                        12              /* board can flicker fix Amiga RGB signal */
574 #define BIB_VIDEOCAPTURE                        13              /* board can capture video data to a memory area */
575 #define BIB_VIDEOWINDOW                         14              /* board can display a second mem area as a pip */
576 #define BIB_BLITTER                                     15              /* board has blitter */
577
578 #define BIB_HIRESSPRITE                         16              /* mouse sprite has double resolution */
579 #define BIB_BIGSPRITE                           17              /* user wants big mouse sprite */
580 #define BIB_BORDEROVERRIDE                      18              /* user wants to override system overscan border prefs */
581 #define BIB_BORDERBLANK                         19              /* user wants border blanking */
582 #define BIB_INDISPLAYCHAIN                      20              /* board switches Amiga signal */
583 #define BIB_QUIET                                               21              /* not yet implemented */
584 #define BIB_NOMASKBLITS                         22              /* perform blits without taking care of mask */
585 #define BIB_NOP2CBLITS                          23              /* use CPU for planar to chunky conversions */
586 #define BIB_NOBLITTER                           24              /* disable all blitter functions */
587 #define BIB_SYSTEM2SCREENBLITS  25              /* allow data to be written to screen memory for cpu as blitter source */
588 #define BIB_GRANTDIRECTACCESS           26              /* all data on the board can be accessed at any time without bi->SetMemoryMode() */
589
590 #define BIB_OVERCLOCK                           31              /* enable overclocking for some boards */
591
592 #define BIB_IGNOREMASK  BIB_NOMASKBLITS
593
594 #define BIF_HARDWARESPRITE                      (1<<BIB_HARDWARESPRITE)
595 #define BIF_NOMEMORYMODEMIX             (1<<BIB_NOMEMORYMODEMIX)
596 #define BIF_NEEDSALIGNMENT                      (1<<BIB_NEEDSALIGNMENT)
597 #define BIF_CACHEMODECHANGE             (1<<BIB_CACHEMODECHANGE)
598 #define BIF_VBLANKINTERRUPT             (1<<BIB_VBLANKINTERRUPT)
599 #define BIF_HASSPRITEBUFFER             (1<<BIB_HASSPRITEBUFFER)
600 #define BIF_VGASCREENSPLIT              (1<<BIB_VGASCREENSPLIT)
601 #define BIF_DBLSCANDBLSPRITEY           (1<<BIB_DBLSCANDBLSPRITEY)
602 #define BIF_ILACEHALFSPRITEY            (1<<BIB_ILACEHALFSPRITEY)
603 #define BIF_ILACEDBLROWOFFSET           (1<<BIB_ILACEDBLROWOFFSET)
604 #define BIF_INTERNALMODESONLY           (1<<BIB_INTERNALMODESONLY)
605 #define BIF_FLICKERFIXER                        (1<<BIB_FLICKERFIXER)
606 #define BIF_VIDEOCAPTURE                        (1<<BIB_VIDEOCAPTURE)
607 #define BIF_VIDEOWINDOW                         (1<<BIB_VIDEOWINDOW)
608 #define BIF_BLITTER                                     (1<<BIB_BLITTER)
609 #define BIF_HIRESSPRITE                         (1<<BIB_HIRESSPRITE)
610 #define BIF_BIGSPRITE                           (1<<BIB_BIGSPRITE)
611 #define BIF_BORDEROVERRIDE                      (1<<BIB_BORDEROVERRIDE)
612 #define BIF_BORDERBLANK                         (1<<BIB_BORDERBLANK)
613 #define BIF_INDISPLAYCHAIN                      (1<<BIB_INDISPLAYCHAIN)
614 #define BIF_QUIET                                               (1<<BIB_QUIET)
615 #define BIF_NOMASKBLITS                         (1<<BIB_NOMASKBLITS)
616 #define BIF_NOP2CBLITS                          (1<<BIB_NOP2CBLITS)
617 #define BIF_NOBLITTER                           (1<<BIB_NOBLITTER)
618 #define BIF_SYSTEM2SCREENBLITS  (1<<BIB_SYSTEM2SCREENBLITS)
619 #define BIF_GRANTDIRECTACCESS           (1<<BIB_GRANTDIRECTACCESS)
620 #define BIF_OVERCLOCK                           (1<<BIB_OVERCLOCK)
621
622 #define BIF_IGNOREMASK  BIF_NOMASKBLITS
623
624 /* write errors, continued for historical reasons... :-) */
625 #define BIB_NOC2PBLITS                          BIB_NOP2CBLITS
626 #define BIF_NOC2PBLITS                          BIF_NOP2CBLITS
627
628 /************************************************************************/
629
630 struct CardBase {
631         struct Library          LibBase;
632         UBYTE                                   Flags;
633         UBYTE                                   pad;
634
635         struct ExecBase *ExecBase;
636         struct Library          *ExpansionBase;
637
638         APTR                                    SegList;
639         char                                    *Name;
640 };
641
642 struct ChipBase {
643         struct Library          LibBase;
644         UBYTE                                   Flags;
645         UBYTE                                   pad;
646
647         struct ExecBase *ExecBase;
648
649         APTR                                    SegList;
650 };
651
652 /************************************************************************/
653 /* private Tags */
654 #define P96BD_BoardType                                 (P96BD_Dummy+0x101)
655 #define P96BD_ChipType                                  (P96BD_Dummy+0x102)
656 #define P96BD_DACType                                   (P96BD_Dummy+0x103)
657 #define P96BD_CurrentScreenBitMap       (P96BD_Dummy+0x104)
658
659 /************************************************************************/
660 #endif