Commit | Line | Data |
---|---|---|
d1add34f GM |
1 | /* |
2 | * Routines to maintain the Operator Information Area. | |
3 | */ | |
4 | ||
5 | #include "oia.h" | |
d6ebedbd | 6 | #include "../general/globals.h" |
d1add34f GM |
7 | |
8 | static int | |
9 | Insert, | |
10 | SystemLocked, | |
11 | PWait, | |
12 | TWait, | |
13 | OnlineA, | |
14 | Ready3274, | |
15 | MyJob; | |
16 | ||
17 | #define X_AREA_SYSTEM 0xc6, "\xb2\xb8" | |
18 | #define X_AREA_CLOCK 0xc6, "\xf2\xf3" | |
19 | #define X_AREA_NULL 0xc6, "" | |
20 | ||
21 | static void | |
1016088f | 22 | OiaXArea(x, xwhy) |
d1add34f GM |
23 | int x; |
24 | char *xwhy; | |
25 | { | |
26 | register int i; | |
27 | ||
28 | OperatorInformationArea.x = x; | |
29 | for (i = 0; i < sizeof OperatorInformationArea.xwhy; i++) { | |
30 | if (*xwhy) { | |
31 | OperatorInformationArea.xwhy[i] = *xwhy++; | |
32 | } else { | |
33 | OperatorInformationArea.xwhy[i] = 0; | |
34 | } | |
35 | } | |
36 | } | |
37 | ||
38 | ||
1016088f | 39 | OiaInsert(onoff) |
d1add34f GM |
40 | int onoff; |
41 | { | |
42 | Insert = onoff; | |
43 | ||
44 | if (onoff) { | |
45 | OperatorInformationArea.insert = OIA_INSERT_ON; | |
46 | } else { | |
47 | OperatorInformationArea.insert = 0; | |
48 | } | |
d6ebedbd | 49 | ScreenOIA(); |
d1add34f GM |
50 | } |
51 | ||
1016088f | 52 | OiaSystemLocked(onoff) |
d1add34f GM |
53 | int onoff; |
54 | { | |
55 | SystemLocked = onoff; | |
56 | ||
57 | if ((PWait == 0) && (TWait == 0)) { | |
1016088f | 58 | OiaXArea(X_AREA_SYSTEM); |
d1add34f | 59 | } |
d6ebedbd | 60 | ScreenOIA(); |
d1add34f GM |
61 | } |
62 | ||
1016088f | 63 | OiaPWait(onoff) |
d1add34f GM |
64 | int onoff; |
65 | { | |
66 | PWait = onoff; | |
67 | ||
68 | if (onoff) { | |
1016088f | 69 | OiaXArea(X_AREA_CLOCK); |
d1add34f GM |
70 | } else { |
71 | if (SystemLocked) { | |
1016088f | 72 | OiaXArea(X_AREA_SYSTEM); |
d1add34f | 73 | } else { |
1016088f | 74 | OiaXArea(X_AREA_NULL); |
d1add34f GM |
75 | } |
76 | } | |
d6ebedbd | 77 | ScreenOIA(); |
d1add34f GM |
78 | } |
79 | ||
1016088f | 80 | OiaTWait(onoff) |
d1add34f GM |
81 | int onoff; |
82 | { | |
83 | TWait = onoff; | |
84 | ||
1016088f | 85 | OiaPWait(onoff); |
d1add34f GM |
86 | } |
87 | ||
1016088f | 88 | OiaOnlineA(onoff) |
d1add34f GM |
89 | int onoff; |
90 | { | |
91 | OnlineA = onoff; | |
92 | ||
93 | if (onoff) { | |
1016088f | 94 | OiaMyJob(1); |
d1add34f GM |
95 | OperatorInformationArea.online = OIA_ONLINE_A; |
96 | } else { | |
97 | OperatorInformationArea.online = 0; | |
98 | } | |
d6ebedbd | 99 | ScreenOIA(); |
d1add34f GM |
100 | } |
101 | ||
1016088f | 102 | OiaReady3274(onoff) |
d1add34f GM |
103 | int onoff; |
104 | { | |
105 | Ready3274 = onoff; | |
106 | ||
107 | if (onoff) { | |
108 | OperatorInformationArea.ready = OIA_READY_3274; | |
109 | } else { | |
110 | OperatorInformationArea.ready = 0; | |
111 | } | |
d6ebedbd | 112 | ScreenOIA(); |
d1add34f GM |
113 | } |
114 | ||
1016088f | 115 | OiaMyJob(onoff) |
d1add34f GM |
116 | int onoff; |
117 | { | |
118 | MyJob = onoff; | |
119 | ||
120 | if (onoff) { | |
121 | OperatorInformationArea.ownership = OIA_OWNERSHIP_MYJOB; | |
122 | } else { | |
123 | OperatorInformationArea.ownership = 0; | |
124 | } | |
d6ebedbd | 125 | ScreenOIA(); |
d1add34f | 126 | } |