2 * Acess2 GUI (AxWin) Version 3
3 * - By John Hodge (thePowersGang)
14 extern void Video_Setup(void);
15 extern void WM_Initialise(void);
16 extern int Renderer_Menu_Init(void);
17 extern int Renderer_Widget_Init(void);
18 extern int Renderer_Background_Init(void);
19 extern int Renderer_Framebuffer_Init(void);
20 extern void WM_Update(void);
23 void ParseCommandline(int argc, char **argv);
26 const char *gsTerminalDevice = NULL;
27 const char *gsMouseDevice = NULL;
29 int giScreenWidth = 640;
30 int giScreenHeight = 480;
32 int giTerminalFD = -1;
35 #define __INSTALL_ROOT "/Acess/Apps/AxWin/3.0"
37 const char *gsInstallRoot = __INSTALL_ROOT;
41 * \brief Program Entrypoint
43 int main(int argc, char *argv[])
45 int server_tid = gettid();
47 ParseCommandline(argc, argv);
49 if( gsTerminalDevice == NULL ) {
50 gsTerminalDevice = "/Devices/VTerm/6";
52 if( gsMouseDevice == NULL ) {
53 gsMouseDevice = "/Devices/Mouse/system";
61 Renderer_Widget_Init();
62 Renderer_Background_Init();
63 Renderer_Framebuffer_Init();
66 // Spawn interface root
67 if( clone(CLONE_VM, 0) == 0 )
69 static char csInterfaceApp[] = __INSTALL_ROOT"/AxWinUI";
70 char server_info[] = "AXWIN3_SERVER=00000";
71 char *envp[] = {server_info, NULL};
72 char *argv[] = {csInterfaceApp, NULL};
73 _SysDebug("server_tid = %i, &server_tid = %p", server_tid, &server_tid);
74 sprintf(server_info, "AXWIN3_SERVER=%i", server_tid);
75 execve(csInterfaceApp, argv, envp);
88 Input_FillSelect(&nfds, &fds);
89 IPC_FillSelect(&nfds, &fds);
92 if( _SysSelect(nfds, &fds, NULL, NULL, NULL, THREAD_EVENT_IPCMSG) == -1 ) {
93 _SysDebug("ERROR: select() returned -1");
97 Input_HandleSelect(&fds);
98 IPC_HandleSelect(&fds);
103 void ParseCommandline(int argc, char **argv)