From: ozkl Date: Sat, 12 Jul 2025 20:47:07 +0000 (+0300) Subject: soso updates X-Git-Url: https://git.0x19.co/screenshots/osx.png?a=commitdiff_plain;h=935156667fe3eafcb602e04efd24dab957eaba39;p=doomgeneric-snom360 soso updates --- diff --git a/doomgeneric/Makefile.soso b/doomgeneric/Makefile.soso index 459c4be..5adc23c 100644 --- a/doomgeneric/Makefile.soso +++ b/doomgeneric/Makefile.soso @@ -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) diff --git a/doomgeneric/doomgeneric_soso.c b/doomgeneric/doomgeneric_soso.c index 15ce4de..e1a3251 100644 --- a/doomgeneric/doomgeneric_soso.c +++ b/doomgeneric/doomgeneric_soso.c @@ -8,14 +8,13 @@ #include #include #include - +#include +#include #include #include #include -#include - 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(); }