Skip to content

Commit

Permalink
Clean up keyboard control module
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj Feliks committed Nov 4, 2023
1 parent 5aff719 commit 930cc09
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 930cc09

Please sign in to comment.