From a88810c8a70c8e3a7533a266774ab61a84a9adf4 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 2 Jul 2023 21:31:19 +0100 Subject: Add sound support --- src/timer.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/timer.c') diff --git a/src/timer.c b/src/timer.c index f3c5898..8702233 100644 --- a/src/timer.c +++ b/src/timer.c @@ -8,6 +8,7 @@ volatile uint32_t clock = 0; volatile uint8_t clock_secs = 0; volatile uint8_t clock_enabled = 0; volatile uint8_t *clock_updated = NULL; +volatile void (*user_fn)(void) = NULL; static _go32_dpmi_seginfo old_handler, new_handler; @@ -29,6 +30,9 @@ static void timer_handler() } } } + + if (user_fn) + user_fn(); } void timer_init() @@ -39,6 +43,11 @@ void timer_init() _go32_dpmi_chain_protected_mode_interrupt_vector(0x1c, &new_handler); } +void timer_user_fn(void (*fn)(void)) +{ + user_fn = fn; +} + void timer_free() { if (_go32_dpmi_set_protected_mode_interrupt_vector(0x1c, &old_handler) == -1) -- cgit v1.2.3