aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-02 21:31:19 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-02 21:31:19 +0100
commita88810c8a70c8e3a7533a266774ab61a84a9adf4 (patch)
tree9ec78cd5e20f06a6cbcbd0251e215f2ecaae71c4 /src/main.c
parent6e03fe85b19bc533888a4689572aab0ccf68edc4 (diff)
downloadgold-mine-run-a88810c8a70c8e3a7533a266774ab61a84a9adf4.tar.gz
gold-mine-run-a88810c8a70c8e3a7533a266774ab61a84a9adf4.zip
Add sound support
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 6207b35..d5b9df8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,6 +6,7 @@
#include "timer.h"
#include "keyb.h"
+#include "sound.h"
#include "vga.h"
#include "data.h"
#include "menu.h"
@@ -18,14 +19,24 @@ void free_all()
{
timer_free();
keyb_free();
+ sound_free();
}
int main(int argc, char *argv[])
{
+ if (!sound_init())
+ {
+ fprintf(stderr, "ERROR: failed to init sound\n");
+ return 1;
+ }
+
timer_init();
keyb_init();
atexit(free_all);
+ /* to update mikmod */
+ timer_user_fn(sound_update);
+
/* set VGA 320x200, 256 col */
if (!set_mode(0x13))
{