From a3d6aa9f8d427b86a33dc05bed98a2e88229a285 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 20 Sep 2023 00:34:26 +0200 Subject: ports: fix the doom port's time handling --- ports/doom/files/doomgeneric_camellia.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/doom/files/doomgeneric_camellia.c b/ports/doom/files/doomgeneric_camellia.c index 596e3d7..816fb51 100644 --- a/ports/doom/files/doomgeneric_camellia.c +++ b/ports/doom/files/doomgeneric_camellia.c @@ -66,15 +66,13 @@ void DG_DrawFrame(void) { dirty_flush(&d, &fb); } -static uint32_t timer = 0; void DG_SleepMs(uint32_t ms) { - timer += ms; _sys_sleep(ms); } uint32_t DG_GetTicksMs(void) { - /* if it's stupid and it works... */ - return timer; + uint32_t ret = _sys_time(0) / 1000000; + return ret; } int DG_GetKey(int *pressed, unsigned char *key) { -- cgit v1.2.3