3 * - Acess kernel emulation on another OS using SDL and UDP
15 void LogF(const char *Fmt, ...)
23 void Log(const char *Fmt, ...)
33 void Warning(const char *Fmt, ...)
43 void Panic(const char *Format, ...)
47 va_start(args, Format);
48 vprintf(Format, args);
54 void Debug_SetKTerminal(const char *Path)
56 // Ignored, kernel debug goes to stdout instead of a virtual terminal
60 void KernelPanic_SetMode(void)
64 void KernelPanic_PutChar(char ch)
66 fprintf(stderr, "%c", ch);
68 void Debug_PutCharDebug(char ch)
74 void Debug_PutStringDebug(const char *String)
77 if( strchr(String, '\n') )
81 void *Heap_Allocate(const char *File, int Line, int ByteCount)
83 return malloc(ByteCount);
86 void *Heap_AllocateZero(const char *File, int Line, int ByteCount)
88 return calloc(ByteCount, 1);
91 void *Heap_Reallocate(const char *File, int Line, void *Ptr, int Bytes)
93 return realloc(Ptr, Bytes);
96 void Heap_Deallocate(void *Ptr)
101 char *Heap_StringDup(const char *File, int Line, const char *Str)
110 tPAddr MM_GetPhysAddr(tVAddr VAddr)
112 return VAddr; // HACK!
115 int MM_IsValidBuffer(tVAddr Base, int Size)
120 Uint MM_GetFlags(tVAddr VAddr)
125 int Modules_InitialiseBuiltin(const char *Name)
134 gettimeofday(&tv, &tz);
135 return tv.tv_sec * 1000 + tv.tv_usec/1000;
138 void IPStack_SendDebugText(const char *str)
143 int strpos(const char *str, char ch)
145 const char *retptr = strchr(str, ch);
146 int rv = retptr ? retptr - str : -1;
147 fprintf(stderr, "strpos: str = %p'%s', retptr = %p, rv = %i\n", str, str, retptr, rv);
151 int CheckString(const char *string)
153 if( (intptr_t)string < 0x1000 )
159 int CheckMem(const void *buf, size_t len)
161 if( (intptr_t)buf < 0x1000 )