From: dopefishh Date: Fri, 9 Oct 2015 11:50:12 +0000 (+0200) Subject: works X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=3c3c801c2d867170e25e3ff3e763a02c0e10f8c5;p=des2015.git works --- diff --git a/mart/ex11/ex11.c b/mart/ex11/ex11.c index 0dbd214..503029f 100644 --- a/mart/ex11/ex11.c +++ b/mart/ex11/ex11.c @@ -12,16 +12,17 @@ #define LPT1IRQ 7 #define TICKS 5 -#define MAXX 16 +#define BANNERWIDTH 10000 +#define MAXX 20 RT_TASK intrtask, drawtask; RTIME ticks[TICKS+1]; RTIME tocks[TICKS+1]; -unsigned char data[MAXX] = { - 1, 2, 4, 8, 16, 32, 64, 128, 256, - 1, 2, 4, 8, 16, 32, 64, 128, 256 -}; +unsigned char data[BANNERWIDTH]; +char* message; +unsigned int pointer = 0; +unsigned int msglen; void add_tick(RTIME *t, RTIME tnew) { @@ -32,7 +33,7 @@ void add_tick(RTIME *t, RTIME tnew) t[TICKS] += t[i]; } t[0] = tnew; - t[TICKS] = t[TICKS]/TICKS; + t[TICKS] = (t[TICKS]+t[0])/TICKS; } void taskd(void *arg) @@ -45,15 +46,14 @@ void taskd(void *arg) outb(0x00, 0x378); rt_task_sleep(step*2); for(i=0; i msglen ? 0 : pointer+1; } void taski(void *arg) @@ -103,9 +103,123 @@ void taski(void *arg) int main(int argc, char* argv[]) { + if(argc != 2){ + printf("Usage: %s \"Message\"\n", argv[0]); + return 1; + } + message = argv[1]; rt_print_auto_init(1); mlockall(MCL_CURRENT | MCL_FUTURE); + unsigned int i; + for(i=0; i