Updated PCI IDs to latest snapshot.
[tangerine.git] / arch / i386-pc / drivers / vga.hidd / vga_init.c
blob91127d4c8ae1099c154c961a0fb239b267c4b501
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: vga gfx Hidd for standalone i386 AROS
6 Lang: english
7 */
9 #define __OOP_NOATTRBASES__
11 #include <exec/types.h>
12 #include <exec/lists.h>
13 #include <proto/exec.h>
14 #include <proto/oop.h>
15 #include <oop/oop.h>
16 #include <utility/utility.h>
17 #include <aros/symbolsets.h>
19 #include "vga.h"
20 #include "vgaclass.h"
22 #include LC_LIBDEFS_FILE
24 extern struct vgaModeDesc vgaDefMode[];
26 #undef SDEBUG
27 #undef DEBUG
28 #define DEBUG 0
29 #include <aros/debug.h>
31 static OOP_AttrBase HiddPixFmtAttrBase; // = 0;
33 static struct OOP_ABDescr abd[] = {
34 { IID_Hidd_PixFmt, &HiddPixFmtAttrBase },
35 { NULL, NULL }
38 static int PCVGA_Init(LIBBASETYPEPTR LIBBASE)
40 struct vga_staticdata *xsd = &LIBBASE->vsd;
41 struct vgaModeEntry *entry;
42 int i;
44 InitSemaphore(&xsd->sema);
45 InitSemaphore(&xsd->HW_acc);
46 NEWLIST(&xsd->modelist);
48 if (!OOP_ObtainAttrBases(abd))
49 return FALSE;
51 /* Insert default videomodes */
53 for (i=0; i<NUM_MODES; i++)
55 entry = AllocMem(sizeof(struct vgaModeEntry),MEMF_CLEAR|MEMF_PUBLIC);
56 if (entry)
58 entry->Desc=&(vgaDefMode[i]);
59 ADDHEAD(&xsd->modelist,entry);
60 D(bug("Added default mode: %s\n", entry->Desc->name));
64 return TRUE;
67 ADD2INITLIB(PCVGA_Init, 0)