diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-07-02 21:31:19 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-07-02 21:31:19 +0100 |
commit | a88810c8a70c8e3a7533a266774ab61a84a9adf4 (patch) | |
tree | 9ec78cd5e20f06a6cbcbd0251e215f2ecaae71c4 /src/timer.c | |
parent | 6e03fe85b19bc533888a4689572aab0ccf68edc4 (diff) | |
download | gold-mine-run-a88810c8a70c8e3a7533a266774ab61a84a9adf4.tar.gz gold-mine-run-a88810c8a70c8e3a7533a266774ab61a84a9adf4.zip |
Add sound support
Diffstat (limited to 'src/timer.c')
-rw-r--r-- | src/timer.c | 9 |
1 files changed, 9 insertions, 0 deletions
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) |