Usermode - Removed SpiderScript
[tpg/acess2.git] / Usermode / Applications / axwin2_src / WM / main.c
1 /*
2  * Acess GUI (AxWin) Version 2
3  * By John Hodge (thePowersGang)
4  */
5 #include "common.h"
6 #include <acess/sys.h>
7
8 // === IMPORTS ===
9 extern void     WM_Update(void);
10 extern int      Input_Init(void);
11
12 // === GLOBALS ===
13 const char      *gsTerminalDevice = NULL;
14 const char      *gsMouseDevice = NULL;
15
16  int    giScreenWidth = 640;
17  int    giScreenHeight = 480;
18 uint32_t        *gpScreenBuffer = NULL;
19
20  int    giTerminalFD = -1;
21  int    giMouseFD = -1;
22  
23
24 // === CODE ===
25 /**
26  * \brief Program Entrypoint
27  */
28 int main(int argc, char *argv[])
29 {
30         ParseCommandline(argc, argv);
31         
32         if( gsTerminalDevice == NULL ) {
33                 gsTerminalDevice = "/Devices/VTerm/6";
34         }
35         if( gsMouseDevice == NULL ) {
36                 gsMouseDevice = "/Devices/PS2Mouse";
37         }
38         
39         Video_Setup();
40         Interface_Init();
41         IPC_Init();
42         Input_Init();
43         
44         WM_Update();
45         
46         // Main Loop
47         for(;;)
48         {
49                 fd_set  fds;
50                  int    nfds = 0;
51                 FD_ZERO(&fds);
52         
53                 Input_FillSelect(&nfds, &fds);
54                 IPC_FillSelect(&nfds, &fds);
55                 
56                 nfds ++;
57                 select(nfds, &fds, NULL, NULL, NULL);
58
59                 Input_HandleSelect(&fds);
60                 IPC_HandleSelect(&fds);
61         }
62         return 0;
63 }
64

UCC git Repository :: git.ucc.asn.au