-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexecclav.c
executable file
·71 lines (71 loc) · 1.77 KB
/
execclav.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <DOS.H>
#include "SOUREXEC/EXECCLAV.H"
void interrupt far Routine_Clavier_Interruption (void);
void (interrupt far *Ancienne_Interruption_Clavier)(void);
char bktouche;
char bktouche2;
char codetouche;
char actiontouche [128];
char bufferfleche [2][128];
void interrupt far Routine_Clavier_Interruption (void)
{
register char x;
codetouche = inp (0x60);
x = inp (0x61);
(void)outp (0x61,(x | 0x80));
(void)outp (0x61,x);
(void)outp (0x20,0x20);
actiontouche[codetouche & 127] = 1;
if (codetouche & 128)
{
actiontouche[codetouche & 127] = 0;
codetouche = 0;
}
}
void far Installer_Clavier_Interruption (void)
{
OCTET cptbuf;
bktouche = 0;
bktouche2 = 0;
for (cptbuf = 0;
cptbuf < 128;
cptbuf++)
{
actiontouche [cptbuf] = 0;
bufferfleche [0][cptbuf] = 0;
bufferfleche [1][cptbuf] = 0;
}
bufferfleche [1][FLECHE_DROITE] =1;
bufferfleche [1][FLECHE_GAUCHE] =2;
bufferfleche [1][FLECHE_BAS ] =3;
bufferfleche [1][FLECHE_HAUT ] =4;
Ancienne_Interruption_Clavier = getvect (CLAVIER_INTERRUPTION);
setvect (CLAVIER_INTERRUPTION,Routine_Clavier_Interruption);
}
void far Desinstaller_Clavier_Interruption (void)
{
disable ();
setvect (CLAVIER_INTERRUPTION,
Ancienne_Interruption_Clavier);
enable ();
}
char far Lire_Code_Touche (void)
{
if (actiontouche [bktouche2] == 1)
return (0);
else
bktouche2 = 0;
bktouche2 = codetouche;
return (codetouche);
}
char far Lire_Action_Touche (char touche)
{
delay (10);
if (actiontouche [bktouche] == 1)
return (0);
if (actiontouche [touche] == 1)
bktouche = touche;
else
bktouche = 0;
return (actiontouche [touche]);
}