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