From 838c8b48b744460f5cf1ee80164029d6c572878d Mon Sep 17 00:00:00 2001 From: coronax Date: Sat, 7 Sep 2024 22:16:22 -0500 Subject: [PATCH] Set the clock id to CLOCK_REALTIME when calling clock_gettime. Previously, time() allocated stack space for the clock id argument, but didn't actually set a value. --- asminc/time.inc | 6 ++++++ libsrc/common/time.s | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/asminc/time.inc b/asminc/time.inc index 6064b4ba3..7c1ab3177 100644 --- a/asminc/time.inc +++ b/asminc/time.inc @@ -66,3 +66,9 @@ .global _clock_settime .global _localtime .global _mktime + + +;------------------------------------------------------------------------------ +; Constants + +CLOCK_REALTIME = 0 diff --git a/libsrc/common/time.s b/libsrc/common/time.s index 40b470f5b..36fd36323 100644 --- a/libsrc/common/time.s +++ b/libsrc/common/time.s @@ -6,7 +6,7 @@ .export _time - .import decsp1, ldeaxi + .import pusha, ldeaxi .importzp ptr1, sreg, tmp1, tmp2 .include "time.inc" @@ -22,7 +22,8 @@ ; Get the time (machine dependent) - jsr decsp1 + lda #CLOCK_REALTIME + jsr pusha lda #