1 /*    SCCS Id: @(#)wbdata.c     3.1    2000/01/12
2 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993.  */
3 /* NetHack may be freely redistributed.  See license for details. */
4 /*
5 struct IntuitionBase *IntuitionBase;
6 struct GfxBase *GfxBase;
7 struct Library *IconBase;
8 struct DiskfontBase *DiskfontBase;
9 */
10 struct Screen *scrn;
11 struct Window *oldwin;
12 char *classes = "ABCEHKPRSTVW";
13 struct TmpRas tmpras;
14 
15 UWORD __chip waitPointer[] =
16 {
17     0x0000,0x0000,
18 
19     0x0400,0x07c0,
20     0x0000,0x07c0,
21 
22     0x0100,0x0380,
23     0x0000,0x07e0,
24 
25     0x07c0,0x1ff8,
26     0x1ff0,0x3fec,
27 
28     0x3ff8,0x7fde,
29     0x3ff8,0x7fbe,
30 
31     0x7ffc,0xff7f,
32     0x7efc,0xffff,
33 
34     0x7ffc,0xffff,
35     0x3ff8,0x7ffe,
36 
37     0x3ff8,0x7ffe,
38     0x1ff0,0x3ffc,
39 
40     0x07c0,0x1ff8,
41     0x0000,0x07e0,
42 
43     0x0000,0x0000
44 };
45 
46 OPTIONS curopts[] =
47 {
48     { 0, 1, "checkpoint", NULL, GADOCHKPOINT },
49     { 0, 1, "color", NULL, GADOCOLOR },
50     { 0, 1, "confirm", NULL, GADOCONFIRM },
51     { 0, 1, "disclose", NULL, GADODISCLOSE },
52     { 0, 0, "female", NULL, GADOFEMALE },
53     { 0, 1, "fixinv", NULL, GADOFIXINV },
54     { 0, 0, "flush", NULL, GADOFLUSH },
55     { 0, 1, "help", NULL, GADOHELP },
56     { 0, 1, "hilite_pet", NULL, GADOHILITEPET },
57     { 0, 0, "ignintr", NULL, GADOIGNINTR },
58     { 0, 1, "legacy", NULL, GADOLEGACY },
59     { 0, 0, "lit_corridor", NULL, GADOLITCORRIDOR },
60     { 0, 1, "news", NULL, GADONEWS },
61     { 0, 0, "number_pad", NULL, GADONUMBERPAD },
62     { 0, 1, "null", NULL, GADONULL },
63     { 0, 1, "autopickup", NULL, GADOPICKUP },
64     { 0, 0, "rest_on_space", NULL, GADORESTONSPACE },
65     { 0, 1, "safepet", NULL, GADOSAFEPET },
66     { 0, 0, "showexp", NULL, GADOSHOWEXP },
67     { 0, 0, "showscore", NULL, GADOSHOWSCORE },
68     { 0, 1, "silent", NULL, GADOSILENT },
69     { 0, 1, "sortpack", NULL, GADOSORTPACK },
70     { 0, 1, "sound", NULL, GADOSOUND },
71     { 0, 0, "standout", NULL, GADOSTANDOUT },
72     { 0, 0, "time", NULL, GADOTIME },
73     { 0, 1, "tombstone", NULL, GADOTOMBSTONE },
74     { 0, 1, "verbose", NULL, GADOVERBOSE },
75     { 0, 0, "asksavedisk", NULL, GADOASKSAVE },
76     { 0, 0, "name", "", GADONAME },
77     { 0, 0, "score", "", GADOSCORE },
78     { 0, 0, "palette", "", GADOPALETTE },
79     { 0, 0, "windowtype", "", GADOWINDOWTYPE },
80     { 0, 0, "msghistory", "", GADOMSGHISTORY },
81     { 0, 0, "pickup_types", "", GADOPICKUPTYPES },
82     { 0, 0, "pettype", "", GADOPETTYPE },
83     { 0, 0, "packorder", "", GADOPACKORDER },
84     { 0, 0, "dogname", "", GADODOGNAME },
85     { 0, 0, "catname", "", GADOCATNAME },
86     { 0, 0, "fruit", "", GADOFRUIT },
87     { 0, 0, "objects", "", GADOOBJECTS },
88     { 0, 0, NULL, NULL, -1 }
89 };
90 
91 char *players[ ] =
92 {
93     "Random",
94     "Archeologist",
95     "Barbarian",
96     "CaveMan",
97     "Elf",
98     "Healer",
99     "Knight",
100 /*    "Monk", */
101     "Priest",
102     "Rogue",
103 /*    "Ranger", */
104     "Samurai",
105     "Tourist",
106     "Valkyrie",
107     "Wizard",
108     NULL
109 };
110 
111 char *options[ NUMIDX + 1 ] =
112 {
113     "Nethack:",				/* PATH_IDX */
114     "",					/* OPTIONS_IDX */
115     "Nethack:",				/* HACKDIR_IDX */
116     "Nethack:levels",			/* LEVELS_IDX */
117     "Nethack:save",			/* SAVE_IDX */
118     "AAA,FFF,620,B08,181,C06,23E,D00",	/* PENS_IDX */
119 
120     NULL,				/* Terminating option */
121 };
122 
123 USHORT __chip up_renderdata[] = {
124 /* Plane 0 */
125    0xfff0,
126    0x8700,
127    0x8f80,
128    0xbfe0,
129    0x8000,
130 
131 /* Plane 1 */
132    0x0008,
133    0x0708,
134    0x0f88,
135    0x3fe8,
136    0x7ff8,
137 
138 };
139 
140 USHORT __chip tall_up_renderdata[] = {
141 /* Plane 0 */
142    0xfff0,
143    0x8700,
144    0x8700,
145    0x8700,
146    0x8f80,
147    0x8f80,
148    0xbfe0,
149    0xbfe0,
150    0xbfe0,
151    0x8000,
152 
153 /* Plane 1 */
154    0x0008,
155    0x0708,
156    0x0708,
157    0x0708,
158    0x0f88,
159    0x0f88,
160    0x3fe8,
161    0x3fe8,
162    0x3fe8,
163    0x7ff8,
164 
165 };
166 
167 struct Image tall_up_renderimage = {
168    0, 0,
169    13, 10, 2,
170    tall_up_renderdata,
171    3,0,
172    NULL
173 };
174 
175 struct Image up_renderimage = {
176    0, 0,
177    13, 5, 2,
178    up_renderdata,
179    3,0,
180    NULL
181 };
182 
183 USHORT __chip tall_up_selectdata[] = {
184 /* Plane 0 */
185    0x0008,
186    0x78f8,
187    0x78f8,
188    0x78f8,
189    0x7078,
190    0x7078,
191    0x4018,
192    0x4018,
193    0x4018,
194    0xfff8,
195 /* Plane 1 */
196    0xfff0,
197    0xf8f0,
198    0xf8f0,
199    0xf8f0,
200    0xf070,
201    0xf070,
202    0xc010,
203    0xc010,
204    0xc010,
205    0x0000
206 };
207 
208 USHORT __chip up_selectdata[] = {
209 /* Plane 0 */
210    0x0008,
211    0x78f8,
212    0x7078,
213    0x4018,
214    0xfff8,
215 /* Plane 1 */
216    0xfff0,
217    0xf8f0,
218    0xf070,
219    0xc010,
220    0x0000
221 };
222 
223 struct Image up_selectimage = {
224    0, 0,
225    13, 5, 2,
226    up_selectdata,
227    3,0,
228    NULL
229 };
230 
231 struct Image tall_up_selectimage = {
232    0, 0,
233    13, 10, 2,
234    tall_up_selectdata,
235    3,0,
236    NULL
237 };
238 
239 USHORT __chip down_renderdata[] = {
240 /* Plane 0 */
241    0xfff0,
242    0xbfe0,
243    0x8f80,
244    0x8700,
245    0x8000,
246 
247 /* Plane 1 */
248    0x0008,
249    0x3fe8,
250    0x0f88,
251    0x0708,
252    0x7ff8,
253 
254 };
255 
256 USHORT __chip tall_down_renderdata[] = {
257 /* Plane 0 */
258    0xfff0,
259    0xbfe0,
260    0xbfe0,
261    0xbfe0,
262    0x8f80,
263    0x8f80,
264    0x8700,
265    0x8700,
266    0x8700,
267    0x8000,
268 
269 /* Plane 1 */
270    0x0008,
271    0x3fe8,
272    0x3fe8,
273    0x3fe8,
274    0x0f88,
275    0x0f88,
276    0x0708,
277    0x0708,
278    0x0708,
279    0x7ff8
280 };
281 
282 struct Image tall_down_renderimage = {
283    0, 0,
284    13, 10, 2,
285    tall_down_renderdata,
286    3,0,
287    NULL
288 };
289 
290 struct Image down_renderimage = {
291    0, 0,
292    13, 5, 2,
293    down_renderdata,
294    3,0,
295    NULL
296 };
297 
298 USHORT __chip down_selectdata[] = {
299 /* Plane 0 */
300    0x0008,
301    0x4018,
302    0x7078,
303    0x78f8,
304    0x7ff8,
305 /* Plane 1 */
306    0xfff0,
307    0xc010,
308    0xf070,
309    0xf8f0,
310    0x8000
311 };
312 
313 USHORT __chip tall_down_selectdata[] = {
314 /* Plane 0 */
315    0x0008,
316    0x4018,
317    0x4018,
318    0x4018,
319    0x7078,
320    0x7078,
321    0x78f8,
322    0x78f8,
323    0x78f8,
324    0x7ff8,
325 /* Plane 1 */
326    0xfff0,
327    0xc010,
328    0xc010,
329    0xc010,
330    0xf070,
331    0xf070,
332    0xf8f0,
333    0xf8f0,
334    0xf8f0,
335    0x8000
336 };
337 
338 struct Image tall_down_selectimage = {
339    0, 0,
340    13, 10, 2,
341    tall_down_selectdata,
342    3,0,
343    NULL
344 };
345 
346 struct Image down_selectimage = {
347    0, 0,
348    13, 5, 2,
349    down_selectdata,
350    3,0,
351    NULL
352 };
353 
354 USHORT __chip leftimg[] =
355 {
356     0x0380, 0x0000,
357     0x0f80, 0x0000,
358     0x3fff, 0xff00,
359     0xffff, 0xff00,
360     0x3fff, 0xff00,
361     0x0f80, 0x0000,
362     0x0380, 0x0000
363 };
364 
365 USHORT __chip rightimg[] =
366 {
367     0x0001, 0xc000,
368     0x0001, 0xf000,
369     0xffff, 0xfc00,
370     0xffff, 0xff00,
371     0xffff, 0xfc00,
372     0x0001, 0xf000,
373     0x0001, 0xc000
374 };
375 
376 struct Image leftarrow =
377 {
378     0, 0,
379     24, 7, 1,
380     leftimg,
381     2, 0,
382     NULL
383 };
384 
385 struct Image rightarrow =
386 {
387     0, 0,
388     24, 7, 1,
389     rightimg,
390     2, 0,
391     NULL
392 };
393 
394 struct Image dnleftarrow =
395 {
396     0, 0,
397     24, 7, 1,
398     leftimg,
399     1, 0,
400     NULL
401 };
402 
403 struct Image dnrightarrow =
404 {
405     0, 0,
406     24, 7, 1,
407     rightimg,
408     1, 0,
409     NULL
410 };
411 
412 struct MsgPort
413     *dosport;
414 
415 PLANEPTR
416     tmprasp;
417 
418 GPTR
419     lastgaddown,	/* Last game gadget user selected */
420     globgptr,
421     windowgads,		/* What is currently attached to the window */
422     gamehead,		/* Pointer to active games */
423     gameavail;		/* Pointer to available allocations */
424 
425 int
426     wbopen = 0,		/* Is workbench open? */
427     shutdown = 0,	/* Close down workbench during game option */
428     errup = 0,		/* Error message on line */
429     cols = 0,		/* Total columns */
430     vcols = 0,		/* Columns visible */
431     scol = -1,		/* Starting column */
432     height,		/* Height of window */
433     width,		/* Width of window */
434     curcol = 0,		/* Offset to first display column */
435     active_count;	/* Number of games active */
436 
437 flag
438     quit=0;		/* time to cleanup */
439 
440 struct Window *win;	/* the window we create */
441