aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-15 22:58:30 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-15 22:58:30 +0100
commita1de326ac5d89cbf9555c9a0a9a662af35c6dcf7 (patch)
treeffe56e86be4acefcee8b89753cf31f7a8c1db20d /src/main.c
parent07e829e591394fa182e75ecab86051f1fb850ce7 (diff)
downloadgold-mine-run-a1de326ac5d89cbf9555c9a0a9a662af35c6dcf7.tar.gz
gold-mine-run-a1de326ac5d89cbf9555c9a0a9a662af35c6dcf7.zip
Implement a countdown clock in the timer
Updated the HUD to show the time.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 306f5f1..0711cf9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <crt0.h>
+#include "timer.h"
#include "keyb.h"
#include "vga.h"
#include "data.h"
@@ -12,10 +13,17 @@
/* disable paging because our int handlers are written in C */
int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
+void free_all()
+{
+ timer_free();
+ keyb_free();
+}
+
int main(int argc, char *argv[])
{
+ timer_init();
keyb_init();
- atexit(keyb_free);
+ atexit(free_all);
/* set VGA 320x200, 256 col */
if (!set_mode(0x13))