-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathODStand.c
More file actions
226 lines (206 loc) · 7.03 KB
/
Copy pathODStand.c
File metadata and controls
226 lines (206 loc) · 7.03 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/* OpenDoors Online Software Programming Toolkit
* (C) Copyright 1991 - 1999 by Brian Pirie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* File: ODStand.c
*
* Description: Implements the OpenDoors standard (default) personality.
*
* Revisions: Date Ver Who Change
* ---------------------------------------------------------------
* Oct 13, 1994 6.00 BP New file header format.
* Dec 09, 1994 6.00 BP Standardized coding style.
* Nov 13, 1995 6.00 BP 32-bit portability.
* Nov 14, 1995 6.00 BP Added include of odscrn.h.
* Nov 16, 1995 6.00 BP Removed oddoor.h, added odcore.h.
* Dec 22, 1995 6.00 BP Added od_connect_speed.
* Dec 24, 1995 6.00 BP Fixed black square at pos 25x80.
* Dec 30, 1995 6.00 BP Added ODCALL for calling convention.
* Feb 19, 1996 6.00 BP Changed version number to 6.00.
* Mar 03, 1996 6.10 BP Begin version 6.10.
* Aug 10, 2003 6.23 SH *nix support
*/
#define BUILDING_OPENDOORS
#include <stdio.h>
#include "OpenDoor.h"
#include "ODCore.h"
#include "ODGen.h"
#include "ODScrn.h"
#include "ODInEx.h"
/* ----------------------------------------------------------------------------
* pdef_opendoors()
*
* Personality function for the OpenDoors standard status line / function key
* personality.
*
* Parameters: btOperation - Indicates personality operation to be performed.
*
* Return: void
*/
ODAPIDEF void ODCALL pdef_opendoors(BYTE btOperation)
{
switch(btOperation)
{
case PEROP_DISPLAY1:
/* Display standard status line. */
ODScrnSetAttribute(0x70);
ODScrnSetCursorPos(1, 24);
ODScrnDisplayString(od_control.od_status_line[0]);
ODScrnSetCursorPos(1, 24);
ODScrnPrintf(od_control.od_status_line[1], od_control.user_name,
od_control.user_location, od_control.od_connect_speed);
ODScrnSetCursorPos(77, 24);
if(od_control.od_node < 1000)
{
ODScrnPrintf("%d]", od_control.od_node);
}
else
{
ODScrnDisplayString("?]");
}
ODScrnSetCursorPos(1,25);
ODScrnDisplayString(od_control.od_status_line[2]);
ODScrnPutText(80, 25, 80, 25, abtGreyBlock);
ODScrnSetCursorPos(11,25);
ODScrnPrintf("%u",od_control.user_security);
ODScrnSetCursorPos(24,25);
ODScrnPrintf(od_control.od_time_left,od_control.user_timelimit);
if(od_control.user_ansi)
{
ODScrnSetCursorPos(40,25);
ODScrnDisplayString("[ANSI]");
}
if(od_control.user_avatar)
{
ODScrnSetCursorPos(47,25);
ODScrnDisplayString("[AVT]");
}
if(od_control.sysop_next)
{
ODScrnSetCursorPos(35,25);
ODScrnDisplayString(od_control.od_sysop_next);
}
if(od_control.user_wantchat)
{
ODScrnSetCursorPos(57,25);
ODScrnSetAttribute(0xf0);
ODScrnDisplayString(od_control.od_want_chat);
}
if(!od_control.od_user_keyboard_on)
{
ODScrnSetCursorPos(58,24);
ODScrnSetAttribute(0xf0);
ODScrnDisplayString(od_control.od_no_keyboard);
}
break;
case PEROP_DISPLAY8:
/* Display help status line. */
ODScrnSetAttribute(0x70);
ODScrnPutText(80, 25, 80, 25, abtGreyBlock);
ODScrnSetCursorPos(1,24);
ODScrnDisplayString(od_control.od_help_text);
ODScrnSetCursorPos(1,25);
/* Display copyright inforomation. */
if(bUserFull)/**/
{
ODScrnDisplayString(od_control.od_help_text2);
}
else
{
ODScrnDisplayString(OD_VER_UNREG_STAT);
}
break;
case PEROP_UPDATE1:
/* Update primary status line. */
ODScrnSetAttribute(0x70);
/* Update user's time limit. */
ODScrnSetCursorPos(24,25);
ODScrnPrintf(od_control.od_time_left,od_control.user_timelimit);
/* Update "sysop next" setting. */
ODScrnSetCursorPos(35,25);
if(od_control.sysop_next)
{
ODScrnDisplayString(od_control.od_sysop_next);
}
else
{
ODScrnDisplayString(" ");
}
/* Update ANSI mode indicator. */
if(od_control.user_ansi)
{
ODScrnDisplayString("[ANSI] ");
}
else
{
ODScrnDisplayString(" ");
}
/* Update AVATAR mode indicator. */
if(od_control.user_avatar)
{
ODScrnDisplayString("[AVT] ");
}
else
{
ODScrnDisplayString(" ");
}
/* Update keyboard-off indicator. */
ODScrnSetCursorPos(58,24);
if(od_control.od_user_keyboard_on)
{
ODScrnDisplayString(" ");
}
else
{
ODScrnSetAttribute(0xf0);
ODScrnDisplayString(od_control.od_no_keyboard);
}
/* Update want-chat indicator. */
ODScrnSetCursorPos(57,25);
if(od_control.user_wantchat)
{
ODScrnSetAttribute(0xf0);
ODScrnDisplayString(od_control.od_want_chat);
}
else
{
ODScrnDisplayString(" ");
}
break;
case PEROP_INITIALIZE:
od_control.key_hangup=0x2300;
od_control.key_drop2bbs=0x2000;
od_control.key_dosshell=0x2400;
od_control.key_chat=0x2e00;
od_control.key_sysopnext=0x3100;
od_control.key_lockout=0x2600;
od_control.key_status[0]=0x3b00;
od_control.key_status[1]=0x0000;
od_control.key_status[2]=0x0000;
od_control.key_status[3]=0x0000;
od_control.key_status[4]=0x0000;
od_control.key_status[5]=0x0000;
od_control.key_status[6]=0x0000;
od_control.key_status[7]=0x4300;
od_control.key_status[8]=0x4400;
od_control.key_keyboardoff=0x2500;
od_control.key_moretime=0x4800;
od_control.key_lesstime=0x5000;
od_control.od_page_statusline=-1;
break;
}
}