AcessNative - Fixed buggy SDL key mappings
[tpg/acess2.git] / AcessNative / acesskernel_src / helpers.c
1 /*
2  * Acess2 Native Kernel
3  * - Acess kernel emulation on another OS using SDL and UDP
4  *
5  * Kernel Main
6  */
7 #include <arch.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <stdarg.h>
11 #include <sys/time.h>
12
13 #if 0
14 void LogF(const char *Fmt, ...)
15 {
16         va_list args;
17         va_start(args, Fmt);
18         vprintf(Fmt, args);
19         va_end(args);
20 }
21
22 void Log(const char *Fmt, ...)
23 {
24         va_list args;
25         printf("Log: ");
26         va_start(args, Fmt);
27         vprintf(Fmt, args);
28         va_end(args);
29         printf("\n");
30 }
31
32 void Warning(const char *Fmt, ...)
33 {
34         va_list args;
35         printf("Warning: ");
36         va_start(args, Fmt);
37         vprintf(Fmt, args);
38         va_end(args);
39         printf("\n");
40 }
41
42 void Panic(const char *Format, ...)
43 {
44         va_list args;
45         printf("Panic: ");
46         va_start(args, Format);
47         vprintf(Format, args);
48         va_end(args);
49         printf("\n");
50         exit(-1);
51 }
52
53 void Debug_SetKTerminal(const char *Path)
54 {
55         // Ignored, kernel debug goes to stdout instead of a virtual terminal
56 }
57 #endif
58
59 void KernelPanic_SetMode(void)
60 {
61         // NOP - No need
62 }
63 void KernelPanic_PutChar(char ch)
64 {
65         fprintf(stderr, "%c", ch);
66 }
67 void Debug_PutCharDebug(char ch)
68 {
69         printf("%c", ch);
70 }
71 void Debug_PutStringDebug(const char *String)
72 {
73         printf("%s", String);
74 }
75
76 void *Heap_Allocate(const char *File, int Line, int ByteCount)
77 {
78         return malloc(ByteCount);
79 }
80
81 void *Heap_AllocateZero(const char *File, int Line, int ByteCount)
82 {
83         return calloc(ByteCount, 1);
84 }
85
86 void *Heap_Reallocate(const char *File, int Line, void *Ptr, int Bytes)
87 {
88         return realloc(Ptr, Bytes);
89 }
90
91 void Heap_Deallocate(void *Ptr)
92 {
93         free(Ptr);
94 }
95
96 void Heap_Dump(void)
97 {
98 }
99
100 tPAddr MM_GetPhysAddr(tVAddr VAddr)
101 {
102         return VAddr;   // HACK!
103 }
104
105 int MM_IsValidBuffer(tVAddr Base, int Size)
106 {
107         return 1;
108 }
109
110 Uint MM_GetFlags(tVAddr VAddr)
111 {
112         return 0;
113 }
114
115 int Modules_InitialiseBuiltin(const char *Name)
116 {
117         return 0;       // Ignored
118 }
119
120 Sint64 now(void)
121 {
122         struct timeval tv;
123         struct timezone tz;
124         gettimeofday(&tv, &tz);
125         return tv.tv_sec * 1000 + tv.tv_usec/1000;
126 }
127
128 void IPStack_SendDebugText(const char *str)
129 {
130         // nop
131 }
132

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