]> git.0x19.co - doomgeneric-snom360/commitdiff
soso updates
authorozkl <ozkl@users.noreply.github.com>
Sat, 12 Jul 2025 20:47:07 +0000 (23:47 +0300)
committerozkl <ozkl@users.noreply.github.com>
Sat, 12 Jul 2025 20:47:07 +0000 (23:47 +0300)
doomgeneric/Makefile.soso
doomgeneric/doomgeneric_soso.c

index 459c4be4fed30c71807f5eed51700179d222bfa6..5adc23c547646d734f0511ad4476f74f8936f275 100644 (file)
@@ -12,9 +12,9 @@ else
 endif
 
 
-CC=soso-clang  # gcc or g++
+CC=musl-clang  # gcc or g++
 CFLAGS+=-O3
-LDFLAGS+=
+LDFLAGS+=-static
 CFLAGS+=-Wall -DNORMALUNIX -DLINUX -DSNDSERV -D_DEFAULT_SOURCE # -DUSEASM
 LIBS+=
 
@@ -35,7 +35,7 @@ clean:
 
 $(OUTPUT):     $(OBJS)
        @echo [Linking $@]
-       soso-clang -v $(LDFLAGS) $(OBJS) -o $(OUTPUT) $(LIBS)
+       musl-clang -v $(LDFLAGS) $(OBJS) -o $(OUTPUT) $(LIBS)
        @echo [Size]
        -$(CROSS_COMPILE)size $(OUTPUT)
 
index 15ce4def0329dbbb08e39c4c6c12e96e3e54f6bd..e1a32517908345671552e225cdc7429def8c7a56 100644 (file)
@@ -8,14 +8,13 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
-
+#include <stdint.h>
+#include <sys/time.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 
 #include <termios.h>
 
-#include <soso.h>
-
 static int FrameBufferFd = -1;
 static int* FrameBuffer = 0;
 
@@ -226,12 +225,17 @@ void DG_DrawFrame()
 
 void DG_SleepMs(uint32_t ms)
 {
-    sleep_ms(ms);
+    usleep(ms * 1000);
 }
 
 uint32_t DG_GetTicksMs()
 {
-    return get_uptime_ms();
+    struct timeval  tp;
+    struct timezone tzp;
+
+    gettimeofday(&tp, &tzp);
+
+    return (tp.tv_sec * 1000) + (tp.tv_usec / 1000); /* return milliseconds */
 }
 
 int DG_GetKey(int* pressed, unsigned char* doomKey)
@@ -263,7 +267,7 @@ int main(int argc, char **argv)
 {
     doomgeneric_Create(argc, argv);
 
-    for (int i = 0; ; i++)
+    while (1)
     {
         doomgeneric_Tick();
     }