From dd038cfb10cae6dba5afabc786a129224da5ef8c Mon Sep 17 00:00:00 2001 From: Aleksa Vučković Date: Wed, 1 Jun 2022 17:02:08 +0200 Subject: simple snake game --- src/c/timer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/c/timer.c') diff --git a/src/c/timer.c b/src/c/timer.c index 3a8f159..ff36882 100644 --- a/src/c/timer.c +++ b/src/c/timer.c @@ -2,12 +2,15 @@ #include #include #include +#include +#include uint32_t tick=0; -const uint32_t TICKS_PER_SECOND=50; extern uint32_t time; uint32_t time=0; +extern uint8_t process_id; + void timer_handler(void) { tick++; @@ -18,7 +21,9 @@ void timer_handler(void) } ioport_out(0x20, 0x20); - ioport_out(0xa0,0x20); + ioport_out(0xa0, 0x20); + + if (process_id == PROCESS_GAME_ID) game_timer_handler(); } void init_timer(uint32_t frequency) -- cgit v1.2.3