-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMEM_KEY.C
79 lines (72 loc) · 1.62 KB
/
MEM_KEY.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
72
73
74
75
76
77
78
79
/**********************************************************************/
/* */
/* Malte System/Direct Keyboard */
/* 1992/10/18 */
/* */
/* Copyright (C) par les Chevaliers de Malte */
/* */
/**********************************************************************/
//
// *** Summary information ***
//
// The file name is : MEM_KEY.C
// The header file name is : MEM_KEY.H
// Created the : 1992/08/14
// Author is : Sylvain Maltais
//
#include <MEM_KEY.H>
Byte MEM_KeyPressed(void)
{
asm XOR AX,AX;
asm MOV ES,AX;
asm MOV DX,ES:[0x041A];
asm CMP DX,ES:[0x041C];
asm JE V0;
return(1);
V0:
return(0);
}
Word MEM_NextKey(void)
{
asm MOV AX,0x0040;
asm MOV ES,AX;
asm MOV DI,ES:[0x001A];
asm MOV AX,ES:[DI];
return(_AX);
}
Word MEM_ReadKey(void)
{
asm XOR AX,AX;
asm MOV ES,AX;
asm MOV SI,0x041A;
L:
asm MOV DI,ES:[SI];
asm CMP DI,ES:[0x041C];
asm JE L;
asm MOV BX,ES:[0x0480];
asm MOV CX,ES:[0x0482];
asm SUB CX,BX;
asm MOV AX,ES:[DI];
asm SUB DI,BX;
asm ADD DI,6;
asm AND DI,CX;
asm ADD DI,BX;
asm MOV ES:[SI],DI;
return(_AX);
}
Byte MEM_KeyFlags(void)
{
asm XOR AX,AX;
asm MOV ES,AX;
asm MOV AL,ES:[0x0417];
return(_AL);
}
Byte MEM_GetModeInsert(void)
{
asm XOR AX,AX;
asm MOV ES,AX;
asm MOV AL,ES:[0x0417];
asm ROL AL,1;
asm AND AL,1;
return(_AL);
}