1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include <ctype.h>
22 #include <ws.h>
23 #include <ws_dcls.h>
24 #include <wsmincap.h>
25 #include <keydefs.h>
26 #include <emulator.h>
27
28 #if EM_DEBUG
29
30 extern int em_tab_size;
31 extern int bg_sender_in;
32 extern int bg_sender_out;
33 extern int bg_sender_buff[];
34 extern char *buff;
35
36 freeze()
37 {
38 int i;
39 int ch;
40
41
42
43
44 while (!get_kb_key(&ch))
45 for (i = 0; i < 100; i++);
46
47 }
48
49
50
51
52
53
54 menu()
55 {
56 int ch;
57
58 printf ("----------------------------------------------------------\n");
59 printf (" * Background messages preceeded by ^\n");
60 printf (" * Preceed input with ^ to write to background\n\n");
61 printf ("\n");
62 printf ("F1 - Freeze display F2 - Select display mode\n");
63 printf ("F3 - Help menu F4 - Toggle local edit\n");
64 printf ("F5 - Toggle term data only F6 - Show query status\n");
65 printf ("F7 - Set tab size F8 - Execute DOS command\n");
66 printf ("F9 - send BREAK F10 - Exit Emulator\n");
67 printf ("\n");
68 printf ("ALT F1 - Toggle Show Packets\n");
69 printf ("ALT F2 - Toggle Diagnose Rejects\n");
70 printf ("ALT F3 - Toggle Extra RCV Chars\n");
71 printf ("----------------------------------------------------------\n");
72 }
73
74
75
76
77
78
79
80 set_tab_size()
81 {
82 int size;
83
84
85
86 printf("$$ Enter new tab size: ");
87 gets(buff);
88
89
90
91
92 if (sscanf(buff,"%d%s",&size) != 1 || size < 1 || size > get_screen_width())
93 printf("$$ -- Invalid tab size, tab size is now %d -- $$\n", em_tab_size);
94 else {
95 em_tab_size = size;
96 printf("$$ New tab size = %d $$\n", em_tab_size);
97 }
98 }
99
100
101
102
103
104
105 execute_dos_cmd()
106 {
107
108
109
110 printf ("$$ Enter DOS command: ");
111 gets(buff);
112
113
114
115 system(buff);
116 printf ("$$ Returning to normal emulation $$\n");
117 }
118
119
120
121
122
123
124 sender_query_status()
125 {
126 int pending;
127 int sys;
128 int major;
129 int i;
130 int index;
131
132
133
134 if (bg_sender_in == bg_sender_out)
135 printf ("$$ No background queries pending $$\n");
136
137
138
139 else {
140 if (bg_sender_in > bg_sender_out)
141 pending = bg_sender_in - bg_sender_out;
142 else
143 pending = bg_sender_in - bg_sender_out + BG_SENDBUFF_SIZE;
144
145
146
147
148 printf ("$$ %d queries pending:\n", pending);
149 for (i = 0; i < pending; i++) {
150 index = (bg_sender_out + i) % BG_SENDBUFF_SIZE;
151 c_unpack(&sys,&major,bg_sender_buff[index]);
152 printf (" Query %2d> system = %4d major = %d\n", i, sys, major);
153 }
154 printf ("$$ Returning to normal emulation $$\n");
155 }
156 }
157
158
159
160
161
162
163
164 reply_to_query()
165 {
166
167
168
169 if (bg_sender_in == bg_sender_out)
170 printf ("$$ No background queries pending $$\n");
171
172
173
174 else {
175 printf ("$$ Enter reply message: ");
176 gets(buff);
177 sendqrep(buff,bg_sender_buff[bg_sender_out]);
178
179
180
181 bg_sender_out = (bg_sender_out+1) % BG_SENDBUFF_SIZE;
182 }
183 }
184 #else
185 freeze ()
186 {}
187 menu ()
188 {}
189 set_tab_size ()
190 {}
191 execute_dos_cmd ()
192 {}
193 sender_query_status ()
194 {}
195 reply_to_query ()
196 {}
197 #endif
198 ^Z