-
Notifications
You must be signed in to change notification settings - Fork 0
/
KEYINT.MAC
executable file
·138 lines (117 loc) · 3.08 KB
/
KEYINT.MAC
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
;-----------------------------------------------------------
;
; Keyboard interrupt server module. This is *very* expanded
; since the original RcBIOS.
;
; This module implements the Menu activated by (currently) the
; CLEAR key.
;-----------------------------------------------------------
subttl File: KEYINT.MAC
keyserver::
dw ks$1 ; Contains the *address* of the routine
; which is to process the keypress.
KEYINTERRUPT: ; PROCEDURE KeyInterrupt;
LD (SAVESP),SP ; BEGIN
LD SP,INTSTACK ; (* Enter interrupt *)
PUSH AF ;
push bc ;
push de ;
push hl ;
push ix ;
;
IN A,(10H) ; (* Here is the SCAN code *)
LD C,A ; Read character and save it
ld hl,(keyserver) ; (* Jump to current keyboard interrupt
jp (hl) ; server. Scan code in A & C *)
;********************** To end the keyinterrupt these routines are available
;
; ks$normal -- Show clock, and set keyboard input to user program.
; ks$none -- Do not change statusline, but set keyboard input to userprogarm.
; x$kbdint -- Set keyboard server to HL.
ks$normal::
call N$statl ; Reset statline
ks$none:: ;
ld hl, ks$1 ; Set normal keyboard server.
;
xsk$kbdint:: ; Exit point to use when transferring
; keyserver rights to other routine.
ld (keyserver), hl ;
x$kbdint:: ; Exit routine for keyboard interrupt.
;
pop ix ;
pop hl ;
pop de ;
pop bc ;
pop af ;
ld sp,(savesp) ;
ei ; (* exit interrupt *)
RETI ; END;
;-------------------------------;
ks$key:: ; Map key to menu key (that is keyin mapped
; and in uppercase)
ld hl, keyintable ;
call translate ;
cp 'a'-1 ; IF key in ['a'..'}'] THEN
ret c ; key:= key -32
cp '}'+1 ;
ret nc ;
add a, 'A'-'a' ;
ret ;
ks$1:: ; Keyboard server #1! (Normal one)
; -------------------
cp SysReqkey ; Is it the System Request key?
jr z, sks$main ;
ld ix, kbdbuf ; IF NOT q$full(kbdbuf) THEN
push bc ; (* Save bc over q$full call *)
call q$full ;
pop bc ;
jr z, x$kbdint ;
;
LD HL,KEYINTABLE ; q$put(kbdbuf, translate(charvalue));
CALL TRANSLATE ;
;
call q$put ;
jr x$kbdint ; bye bye.
sks$main::
ld hl, main$stat ;
call s$statl ;
ld hl, ks$main ; Set keyboard server to #2
jr xsk$kbdint ;
ks$main:: ; Primary menu!!
call ks$key ;
cp 'D' ; IF 'D' THEN Show (DiskStatusLinie);
jr z, sks$d ;
cp 'N' ;
jr z, ks$nkey ; IF 'N' then KeyBmode:= Normal
cp 'L' ;
jr z, ks$lkey ; IF 'L' then KeyBmode:= LaTeX
cp 'I' ;
jr z, ks$ikey ; IF 'I' then KeyBmode:= ISO-8859-1
cp ' ' ;
jr z, ks$normal ; IF ' ' then Cancel mode.
jr x$kbdint ; Sorry, not interested in key.
; ---
ks$nkey::
lda0 ; Set normal keyboard.
ld (keybmode), a ;
jr ks$normal
ks$lkey::
ld a, 1 ; Set LaTeX keyboard.
ld (keybmode), a ;
jr ks$normal ;
ks$ikey::
ld a, 2 ; Set ISO keyboard.
ld (keybmode), a ;
jr ks$normal ;
; -----
sks$d::
ld hl, dio$st ; Show disk statusline and normalize keyboard
call s$statl ;
jr ks$none ;
; ** Main menu line routine
main$stat:
ld hl, main$msg
ret
main$msg:
db 144, 'D)isk, L)aTeX, I)SO, N)ormal 930726', 0
; --- END OF KEYINT.MAC ---