diff --git a/control.c b/control.c index 767a5b3..2dc20b6 100644 --- a/control.c +++ b/control.c @@ -10,25 +10,29 @@ #include "globals.h" -void interrupt (*old_keyboard)(); +void interrupt (*old_keyboard)(void); void interrupt my_keyboard(void) { - int key = inportb(0x60); + int key; + + key = inportb(0x60); outportb(0x20, 0x20); - if (key & 0x80) + + if (key & 0x80) { keytab[key - 0x80] = 0; - else + } + else { keytab[key] = 1; + } } void init_keyboard(void) { - int x; old_keyboard = getvect(9); setvect(9, my_keyboard); - for (x = 0; x < 256; x++) - keytab[x] = 0; + + memset(keytab, 0, 256); } void restore_keyboard(void)