From b5255444cdd5e8819dd079e3d736c4cd92b8b41f Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Mon, 22 May 2023 20:36:33 +0200 Subject: [PATCH] irq-safe irqd handling for RDTIM16 --- compiler/res/prog8lib/cx16/syslib.p8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/res/prog8lib/cx16/syslib.p8 b/compiler/res/prog8lib/cx16/syslib.p8 index 37542bc08..d8353606c 100644 --- a/compiler/res/prog8lib/cx16/syslib.p8 +++ b/compiler/res/prog8lib/cx16/syslib.p8 @@ -70,9 +70,10 @@ asmsub RDTIM16() -> uword @AY { ; -- like RDTIM() but only returning the lower 16 bits in AY for convenience %asm {{ phx + php sei jsr c64.RDTIM - cli + plp pha txa tay @@ -927,6 +928,7 @@ sys { asmsub wait(uword jiffies @AY) { ; --- wait approximately the given number of jiffies (1/60th seconds) (N or N+1) ; note: the system irq handler has to be active for this to work as it depends on the system jiffy clock + ; note: this routine cannot be used from inside a irq handler %asm {{ phx sta P8ZP_SCRATCH_W1