14 int mb_used = 6; /* 6MB heap */
23 byte* I_ZoneBase (int *size)
25 *size = mb_used*1024*1024;
26 return (byte *) malloc(*size);
29 /* returns time in 1/70th second tics */
32 return (int)((nsec()*TICRATE)/1000000000);
35 static ticcmd_t emptycmd;
36 ticcmd_t* I_BaseTiccmd (void)
51 byte* I_AllocLow (int length)
55 mem = (byte *)malloc (length);
56 memset (mem,0,length);
60 void I_Tactile(int on, int off, int total)
67 ticcmd_t* I_BaseTiccmd(void)
73 int I_GetHeapSize (void)
75 return mb_used*1024*1024;
78 byte* I_ZoneBase (int* size)
80 *size = mb_used*1024*1024;
81 return (byte *) malloc (*size);
89 extern boolean demorecording;
91 void I_Error (char *error, ...)
96 va_start (argptr,error);
97 fprintf (stderr, "Error: ");
98 vfprintf (stderr,error,argptr);
99 fprintf (stderr, "\n");
104 // Shutdown. Here might be other errors.
109 I_ShutdownGraphics();
114 int I_FileExists (char *filepath)
116 return (0 == access(filepath, AREAD));
119 int I_Open (char *filepath)
121 return open(filepath, OREAD);
124 void I_Close (int handle)
129 int I_Seek (int handle, int n)
131 return seek(handle, n, 0);
134 int I_Read (int handle, void *buf, int n)
136 return read(handle, buf, n);
139 char* I_IdentifyWAD(char *wadname)
143 snprintf(path, sizeof path, "/sys/lib/doom/%s", wadname);
144 if (I_FileExists (path))
147 snprintf(path, sizeof path, "/sys/games/lib/doom/%s", wadname);
148 if (I_FileExists (path))
151 snprintf(path, sizeof path, "%s/lib/doom/%s", getenv("home"), wadname);
152 if (I_FileExists (path))