5 #include <graphics/gfxbase.h>
6 #include <libraries/asl.h>
7 #include <proto/exec.h>
8 #include <proto/datatypes.h>
12 #include "DriverData.h"
15 #include <proto/stdc.h>
17 struct StdCBase
*StdCBase
= NULL
;
21 /******************************************************************************
22 ** Custom driver init *********************************************************
23 ******************************************************************************/
26 DriverInit( struct DriverBase
* AHIsubBase
)
28 struct FilesaveBase
* FilesaveBase
= (struct FilesaveBase
*) AHIsubBase
;
30 FilesaveBase
->dosbase
= (struct DosLibrary
*)OpenLibrary( DOSNAME
, 37 );
31 FilesaveBase
->gfxbase
= (APTR
)OpenLibrary( GRAPHICSNAME
, 37 );
32 FilesaveBase
->aslbase
= OpenLibrary( AslName
, 37);
33 FilesaveBase
->dtsbase
= OpenLibrary( "datatypes.library" ,39 );
37 Req( "Unable to open '" DOSNAME
"' version 37.\n" );
43 Req( "Unable to open '" GRAPHICSNAME
"' version 37.\n" );
47 // Don't fail if these ones don't open!
51 Req( "Unable to open '" AslName
"' version 37.\n" );
55 if( DataTypesBase
== NULL
)
57 Req( "Unable to open 'datatypes.library' version 39.\n" );
62 if ((IDOS
= (struct DOSIFace
*) GetInterface((struct Library
*) DOSBase
, "main", 1, NULL
)) == NULL
)
64 Req("Couldn't open IDOS interface!\n");
68 if (AslBase
!= NULL
) {
69 if ((IAsl
= (struct AslIFace
*) GetInterface((struct Library
*) AslBase
, "main", 1, NULL
)) == NULL
)
71 Req("Couldn't open IAsl interface!\n");
76 if (DataTypesBase
!= NULL
) {
77 if ((IDataTypes
= (struct DataTypesIFace
*) GetInterface((struct Library
*) DataTypesBase
, "main", 1, NULL
)) == NULL
)
79 Req("Couldn't open IDataTypes interface!\n");
86 StdCBase
= (struct StdCBase
*) OpenLibrary( "stdc.library", 0 );
88 if( StdCBase
== NULL
)
90 Req( "Unable to open 'stdc.library'.\n" );
99 /******************************************************************************
100 ** Custom driver clean-up *****************************************************
101 ******************************************************************************/
104 DriverCleanup( struct DriverBase
* AHIsubBase
)
106 struct FilesaveBase
* FilesaveBase
= (struct FilesaveBase
*) AHIsubBase
;
109 CloseLibrary( (struct Library
*) StdCBase
);
113 DropInterface( (struct Interface
*) IDOS
);
114 DropInterface( (struct Interface
*) IAsl
);
115 DropInterface( (struct Interface
*) IDataTypes
);
118 CloseLibrary( (APTR
)FilesaveBase
->dosbase
);
119 CloseLibrary( (APTR
)FilesaveBase
->gfxbase
);
120 CloseLibrary( (APTR
)FilesaveBase
->aslbase
);
121 CloseLibrary( (APTR
)FilesaveBase
->dtsbase
);