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+=
$(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)
#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;
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)
{
doomgeneric_Create(argc, argv);
- for (int i = 0; ; i++)
+ while (1)
{
doomgeneric_Tick();
}