2 Copyright 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Backwards compatibility display driver loader.
9 #include <aros/debug.h>
10 #include <dos/dosextens.h>
12 #include <workbench/startup.h>
13 #include <workbench/workbench.h>
14 #include <proto/dos.h>
15 #include <proto/exec.h>
16 #include <proto/graphics.h>
17 #include <proto/oop.h>
18 #include <proto/icon.h>
20 /************************************************************************/
28 extern struct WBStartup
*WBenchMsg
;
30 int __nocommandline
= 1;
36 struct DiskObject
*icon
;
37 struct RDArgs
*rdargs
= NULL
;
39 struct MyArgs args
= {NULL
};
42 olddir
= CurrentDir(WBenchMsg
->sm_ArgList
[0].wa_Lock
);
43 myname
= WBenchMsg
->sm_ArgList
[0].wa_Name
;
45 struct Process
*me
= (struct Process
*)FindTask(NULL
);
48 struct CommandLineInterface
*cli
= BADDR(me
->pr_CLI
);
50 myname
= AROS_BSTR_ADDR(cli
->cli_CommandName
);
52 myname
= me
->pr_Task
.tc_Node
.ln_Name
;
54 D(Printf("Command name: %s\n", myname
));
56 icon
= GetDiskObject(myname
);
57 D(Printf("Icon 0x%p\n", icon
));
60 args
.hidd
= FindToolType(icon
->do_ToolTypes
, "CLASS");
61 args
.lib
= FindToolType(icon
->do_ToolTypes
, "LIBRARY");
65 rdargs
= ReadArgs("CLASS=HIDD/A,LIBRARY=LIB", (IPTR
*)&args
, NULL
);
66 D(Printf("RDArgs 0x%p\n", rdargs
));
69 D(Printf("CLASS=%s, LIBRARY=%s\n", args
.hidd
? args
.hidd
: "<none>",
70 args
.lib
? args
.lib
: "<none>"));
75 struct Library
*gfxlib
= NULL
;
77 cl
= OOP_FindClass(args
.hidd
);
82 gfxlib
= OpenLibrary(args
.lib
, 0);
89 cl
= OOP_FindClass(args
.hidd
);
92 if (AddDisplayDriverA(cl
, NULL
, NULL
))
100 if ((res
!= RETURN_OK
) && gfxlib
)
101 CloseLibrary(gfxlib
);
110 FreeDiskObject(icon
);