1 /*  menus.c */
2 
3 /*  Copyright Hugh Robinson 2006-2008.
4 
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 3 of the License, or
8     (at your option) any later version.
9 
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14 
15     You should have received a copy of the GNU General Public License
16     along with this program.  If not, see <http://www.gnu.org/licenses/>. */
17 
18 #include <SDL/SDL.h>
19 
20 #include "asylum.h"
21 
22 extern fastspr_sprite charsadr[48];
23 
24 extern char sound_available;
25 extern asylum_options options;
26 extern char plscore[8];
27 
28 char highscorearea[13*5+1];           //=&D000
29 char hstindex;
30 
escapehandler()31 int escapehandler()
32 {
33     //frameinc = 1;
34     showchatscreen();
35     swi_fastspr_clearwindow();
36     wipetexttab();
37     message(36, 40-256, 0, 4, "� Game Interrupted �");
38     message(32-256, 72, 4, 0, "Please select action");
39     message(46+256, 104, -4, 0, "ESC - Abandon game");
40     message(40-256, 136, 4, 0, "Q    - lose this life");
41     message(40, 168+256, 0, -4, "R    - Return to Game");
42     message(40, 200+256, 0, -4, "O    - Alter Options");
43     showtext();
44     osbyte_7c(); //clear escape
45     for (int r9 = 64; swi_readescapestate() == 0;)
46     {
47        loopb8:
48         swi_blitz_wait(0);
49         if (r9 != 0)
50         {
51             r9--;
52             switchbank();
53             swi_fastspr_clearwindow();
54             texthandler(1);
55         }
56         else if (need_redraw())
57         {
58             showchatscreen();
59             showtext();
60         }
61         switch (osbyte_79_unicode(1))
62         {
63             case 'q': case 'Q':
64                 loselife();
65                 return 0;
66             case 'o': case 'O':
67                 adjustopt();
68                 return 0;
69             case 'r': case 'R':
70                 rejoin();
71                 return 0;
72         }
73     }
74     osbyte_7c();
75     return 1;
76 }
77 
rejoin()78 void rejoin()
79 {
80     wipetexttab();
81     showgamescreen();
82 }
83 
adjustopt()84 void adjustopt()
85 {
86     options_menu(1); // mark as in game
87     rejoin();
88 }
89 
options_menu(int gameon)90 int options_menu(int gameon)
91 {
92     while (1)
93     {
94         clearkeybuf();
95         wipetexttab();
96         showchatscreen();
97         swi_fastspr_clearwindow();
98         message(128, 48, 0, 0, "Options");
99         message(32, 96, 0, 0, "1. Define Controls");
100         message(32, 128, 0, 0, "2. Tune Game Options");
101         message(88, 224, 0, 0, "Fire - Play");
102         if (gameon == 0) message(32, 160, 0, 0, "3. Choose Mental Zone");
103         else message(32, 160, 0, 0, "3. Save Position");
104 // if (savedornot==1) message(32,192,0,0,"4. Save Settings");
105         showtext();
106         swi_blitz_wait(20); //
107         switch (readopt((gameon == 0) ? 3 : 3))
108         {
109         case -1: optionexit: return 1;
110         case  1: choosecontrol(); dosaveconf(); break;
111         case  2: tunegame(); dosaveconf(); break;
112         case  3: if (gameon == 0)
113             {
114                 getzone(); dosaveconf();
115             }
116             else
117                 savegame();
118             break;
119 //case  4: if (savedornot==1) dosaveconf(); break;
120         default: soundupdate(); return 0;
121         }
122     }
123 }
124 
dosaveconf()125 void dosaveconf()
126 {
127     saveconfig();
128 }
129 
getzone()130 void getzone()
131 {
132     int r0;
133 
134     wipetexttab();
135     showchatscreen();
136     message(88, 48, 0, 0, "Choose which");
137     message(96, 68, 0, 0, "mental zone");
138     message(64, 96, 0, 0, "1. Ego");
139     message(64, 128, 0, 0, "2. Psyche");
140     message(64, 160, 0, 0, "3. Id");
141     if (checkifextend())
142     {
143         message(64, 192, 0, 0, "4. Saved Game");
144         r0 = 4;
145     }
146     else r0 = 3;
147     showtext();
148     r0 = readopt(r0);
149     if (r0 == -1) return;
150     if ((r0 == 3) && ( /*testid:*/ options.idpermit != 1))
151     {
152         wipetexttab();
153         showchatscreen();
154         message(80, 100, 0, 0, "To play the id");
155         message(32, 128, 0, 0, "you need to complete");
156         message(80, 156, 0, 0, "the ego first.");
157         showtext();
158         readopt(0);
159     }
160     else options.mentalzone = r0;
161 }
162 
completedzone()163 void completedzone()
164 {
165    completedzone:
166     message(114, 64, 0, 0, "WELL DONE!");
167     message(44, 96, 0, 0, "You have completed");
168     if (options.mentalzone == 3) message(114, 128, 0, 0, "The game!!!");
169     else message(114, 128, 0, 0, "This zone!");
170 }
171 
choosecontrol()172 void choosecontrol()
173 {
174     wipetexttab();
175     showchatscreen();
176     message(96, 48, 0, 0, "Controls");
177     message(64, 96, 0, 0, "1. Keyboard");
178     message(64, 128, 0, 0, "2. Joystick");
179     showtext();
180     switch (readopt(2))
181     {
182     case-1: return;
183     case  1: choosekeys(); return;
184     case  2: choosestick(); return;
185     }
186 }
187 
choosekeys()188 void choosekeys()
189 {
190     wipetexttab();
191     showchatscreen();
192     options.leftkey = selectkey(48, 128, 0, 0, "Press Key For Left");
193     options.rightkey = selectkey(48, 128, 0, 0, "Press Key For Right");
194     options.upkey = selectkey(48, 128, 0, 0, "Press Key For Up");
195     options.downkey = selectkey(48, 128, 0, 0, "Press Key For Down");
196     options.firekey = selectkey(48, 128, 0, 0, "Press Key to Fire");
197 }
198 
choosestick()199 void choosestick()
200 {
201     wipetexttab();
202     showchatscreen();
203     message(88, 48, 0, 0, "Joystick");
204     message(64, 96, 0, 0, "Joystick Number");
205     message(136, 128, 0, 0, "0-3");
206     showtext();
207     options.joyno = 1+readopt(3);
208     if (options.joyno == 0) return;
209     wipetexttab();
210     showchatscreen();
211     message(96, 48, 0, 0, "Reminder");
212     message(48, 96, 0, 0, "To jump, you can");
213     message(32, 128, 0, 0, "1. Use Joystick Up");
214     message(32, 160, 0, 0, "2. Use Fire Button 2");
215     message(64, 180, 0, 0, "If you have one.");
216     message(32, 212, 0, 0, "3. Use The Up Key");
217     showtext();
218     (void)readopt(9);
219 }
220 
221 
tunegame()222 void tunegame()
223 {
224     wipetexttab();
225     showchatscreen();
226     message(96, 48, 0, 0, "Tune Game");
227     if (sound_available)
228     {
229         message(64, 96, 0, 0, "1. Sound System");
230         message(64, 128, 0, 0, "2. Sound Volume");
231     }
232     else
233     {
234         message(48, 96, 0, 0, "\x11");
235         message(48, 128, 0, 0, "\x11");
236         message(64, 96, 0, 0, "1.");
237         message(64, 128, 0, 0, "2.");
238         message(115, 101, 0, 0, "Sound Not");
239         message(112, 123, 0, 0, "Available");
240     }
241     message(64, 160, 0, 0, "3. Video System");
242     showtext();
243     while (1)
244         switch (readopt(3))
245         {
246         case-1: return;
247         case  1: if (sound_available)
248             {
249                 tunesound(); return;
250             }
251             else break;
252         case  2: if (sound_available)
253             {
254                 tunevolume(); return;
255             }
256             else break;
257         case  3: tunespeed(); return;
258         }
259 }
260 
261 char sound1[] = "-1. No Sound";
262 char sound2[] = "-2. 4 Channels";
263 char sound3[] = "-3. 4 Channels";
264 char sound4[] = "-4. 8 Channels";
265 char sound5[] = "-5. Normal Quality";
266 char sound6[] = "-6. High Quality";
267 char sound7[] = "-7. Overdrive";
268 
tunesound()269 void tunesound()
270 {
271     showchatscreen();
272     for (;; /*tunesoundloop:*/ soundupdate(), swi_stasis_link(1, 1), swi_sound_control(1, -15, 0x20, 0xfe))
273     {
274        tunesoundins:
275         wipetexttab();
276         soundfillin();
277         message(96, 32, 0, 0, "Tune Sound");
278         message(32, 60, 0, 0, sound1);
279         message(32, 80, 0, 0, sound2);
280         message(32, 100, 0, 0, sound3);
281         message(80, 120, 0, 0, "and music");
282         message(32, 140, 0, 0, sound4);
283         message(32, 160, 0, 0, sound5);
284         message(32, 180, 0, 0, sound6);
285         message(32, 200, 0, 0, sound7);
286         message(96, 220, 0, 0, "ESC - Exit");
287         swi_blitz_wait(0);
288         swi_fastspr_clearwindow();
289         showtext();
290 
291         switch (readopt(7))
292         {
293         case 1: options.soundtype = 0; break;
294         case 2: options.soundtype = 1; break;
295         case 3: options.soundtype = 2; break;
296         case 4: options.soundtype = 3; break;
297         case 5: options.soundquality &= ~1; break;
298         case 6: options.soundquality |= 1; break;
299         case 7: options.soundquality ^= 2; break;
300         default: return;
301         }
302     }
303 }
304 
soundfillin()305 void soundfillin()
306 {
307     sound1[0] = (options.soundtype == 0) ? 16 : 17;
308     sound2[0] = (options.soundtype == 1) ? 16 : 17;
309     sound3[0] = (options.soundtype == 2) ? 16 : 17;
310     sound4[0] = (options.soundtype == 3) ? 16 : 17;
311     sound5[0] = (options.soundquality&1) ? 17 : 16;
312     sound6[0] = (options.soundquality&1) ? 16 : 17;
313     sound7[0] = (options.soundquality&2) ? 16 : 17;
314 }
315 
316 char tunevol1[] = "-5. Speaker on";
317 
tunevolume()318 void tunevolume()
319 {
320     showchatscreen();
321     wipetexttab();
322     if (sound_available && (options.soundtype == 2)) swi_bodgemusic_start(1, 0);
323     swi_bodgemusic_volume(options.musicvol);
324     message(80, 32, 0, 0, "Change volume");
325     message(48, 96, 0, 0, "1. Louder effects");
326     message(48, 116, 0, 0, "2. Quieter effects");
327     message(48, 136, 0, 0, "3. Louder music");
328     message(48, 156, 0, 0, "4. Quieter music");
329     message(48-14, 176, 0, 0, tunevol1);
330     message(96, 220, 0, 0, "ESC - Exit");
331     do
332     {
333        tunevolumeloop:
334         swi_bodgemusic_volume(options.musicvol);
335         if (swi_sound_speaker(0)) *tunevol1 = 17;
336         else *tunevol1 = 16;
337         swi_blitz_wait(0);
338         swi_fastspr_clearwindow();
339         showtext();
340         int r0 = readopt(5);
341         if (r0 == -1) return;
342 
343         if (r0 == 1)
344         {
345             if (options.soundvol < 0x40) options.soundvol = options.soundvol*2+1;
346 	    maketestsound(options.soundvol);
347 	    continue;
348         }
349         if (r0 == 2)
350         {
351             if (options.soundvol > 0) options.soundvol = (options.soundvol-1)/2;
352 	    maketestsound(options.soundvol);
353 	    continue;
354         }
355         if (r0 == 3)
356         {
357             if (options.musicvol < 0x40) options.musicvol = options.musicvol*2+1;
358 	    maketestsound(options.musicvol);
359 	    continue;
360         }
361         if (r0 == 4)
362         {
363             if (options.musicvol > 0) options.musicvol = (options.musicvol-1)/2;
364 	    maketestsound(options.musicvol);
365 	    continue;
366         }
367 
368         if (r0 != 5) return;
369         swi_sound_speaker(3-swi_sound_speaker(0));
370     }
371     while (1);
372 }
373 
374 
375 char speed1[] = "-1. Full Screen";
376 char speed2[] = "-2. Use OpenGL";
377 char speed3[] = "-4. Half scale";
378 char sizedesc[][16] = {" 3.  320 x  256",
379 		       " 3.  640 x  512",
380 		       " 3.  960 x  768",
381 		       " 3. 1280 x 1024"};
382 
tunespeed()383 void tunespeed()
384 {
385     do
386     {
387         showchatscreen();
388         do
389         {
390            tunespeedloop:
391             wipetexttab();
392             if (options.fullscreen == 1) speed1[0] = 16;
393             else speed1[0] = 17;
394             if (options.opengl == 1) speed2[0] = 16;
395             else speed2[0] = 17;
396             if (options.scale == 2) speed3[0] = 16;
397             else speed3[0] = 17;
398             message(96, 48, 0, 0, "Tune Video");
399             message(32, 96, 0, 0, speed1);
400             message(32, 120, 0, 0, speed2);
401 	    if (options.opengl)
402 	    {
403 		message(32, 144, 0, 0, sizedesc[options.size&3]);
404 		message(32, 168, 0, 0, speed3);
405 		message(80, 188, 0, 0, "-experimental-");
406 	    }
407             message(96, 220, 0, 0, "ESC - Exit");
408 
409             swi_blitz_wait(0);
410             swi_fastspr_clearwindow();
411             showtext();
412             int r0 = readopt(4);
413             if (r0 == -1) return;
414             else if (r0 == 1)
415             {
416                 options.fullscreen ^= 1;
417 		vduread(options); break;
418             }
419             else if (r0 == 2)
420             {
421                 options.opengl ^= 1;
422 		if (options.opengl == 0)
423 		{
424 		    options.size = 0;
425 		    options.scale = 1;
426 		}
427 		vduread(options);
428 		getvitalfiles();
429 		getgamefiles();
430 		getlevelsprites();
431 		break;
432             }
433 	    else if (options.opengl == 0);
434             else if (r0 == 3)
435             {
436                 options.size = (options.size+1) % 4;
437 		vduread(options);
438 		getvitalfiles();
439 		getgamefiles();
440 		getlevelsprites();
441 		break;
442             }
443             else if (r0 == 4)
444             {
445                 options.scale ^= 3;
446 		vduread(options); break;
447             }
448         }
449         while (1);
450     }
451     while (1);
452 }
453 
selectkey(int x,int y,int xv,int yv,const char * a)454 int selectkey(int x, int y, int xv, int yv, const char* a)
455 {
456     int r1;
457 
458     wipetexttab();
459     showchatscreen();
460     clearkeybuf();
461     message(x, y, xv, yv, a);
462     showtext();
463     do
464     {
465         if (need_redraw())
466         {
467             showchatscreen();
468             showtext();
469         }
470         swi_blitz_wait(1);
471     }
472     while ((r1 = osbyte_79(0)) == -1); // scan keyboard
473     if (swi_readescapestate()) return 0;
474     return -r1;                        // and r4 (?)
475 }
476 
readopt(int maxopt)477 int readopt(int maxopt)
478 {
479     int r1;
480 
481     for (;;)
482     {
483        keyloop:
484         if (options.joyno != 0)
485         {
486             swi_joystick_read(options.joyno-1, NULL, NULL);
487 // MOVVS R0,#0
488 //if (r0&(1<<16)) {/*optfire:*/ return 0;}
489         }
490        nooptstick:
491         r1 = osbyte_79_unicode(1); // read key in time limit
492         if (swi_readescapestate())
493         {
494            optescape:
495             osbyte_7c(); // clear escape
496             return -1;
497         }
498         if (r1 >= '0' && r1 <= '0' + maxopt)
499             return r1 - '0';
500         if (osbyte_81(options.firekey) == 0xff)
501             return 0;
502         if (need_redraw())
503         {
504             showchatscreen();
505             showtext();
506         }
507         swi_blitz_wait(1);
508     }
509 }
510 
511 const int _x = 250;
512 const int _v = -1;
513 
prelude()514 int prelude()
515 {
516     int cheatpermit = 0;
517     //frameinc = 1;
518     showchatscreen();
519     swi_fastspr_clearwindow();
520     wipetexttab();
521     message(2048, _x, 0, _v, "Digital Psychosis");
522     message(2108, _x+24, 0, _v, "Presents");
523     message(2152, _x+(24*5)/2, 0, _v, "#");
524     message(2040, _x+4*24, 0, _v, "Young Sigmund has a");
525     message(2056, _x+5*24, 0, _v, "Few problems. Can");
526     message(2056, _x+6*24, 0, _v, "you help him find");
527     message(2028, _x+7*24, 0, _v, "the rogue brain cells");
528     message(2036, _x+8*24, 0, _v, "in his mind and shut");
529     message(2100, _x+9*24, 0, _v, "Them down?");
530     message(2096, _x+10*24, 0, _v, "PRESS SPACE");
531     message(2088, _x+12*24, 0, _v, "Cheat Mode!!!");
532     message(2028, _x+14*24, 0, _v, "F1, F2 Get Weapons");
533     message(2028, _x+15*24, 0, _v, "F3 - Restore Strength");
534     message(2096, _x+17*24, 0, _v, "HAVE FUN !!!");
535 
536 
537     showtext();
538     for (int scroll = 256+8; swi_readescapestate() == 0;)
539     {
540        loope0:
541         swi_blitz_wait(2);
542         if (scroll != 0)
543         {
544             scroll--;
545             switchbank();
546             swi_fastspr_clearwindow();
547             texthandler(1);
548         }
549         else if (need_redraw())
550         {
551             showchatscreen();
552             showtext();
553         }
554        preludetextstop:;
555         int r1 = osbyte_7a();
556         if ((r1 != -1) && (r1 != 307) && (r1 != 308)) // escape
557            endprelude:
558             return cheatpermit;
559         if (readmousestate()&2)
560         {
561            gocheat:
562             if (osbyte_81(-SDLK_LALT) != 0xff) return cheatpermit;
563             if (osbyte_81(-SDLK_RALT) != 0xff && osbyte_81(-SDLK_MODE) != 0xff) return cheatpermit;
564             cheatpermit = 1;
565             scroll = 1024;
566         }
567     }
568     osbyte_7c();
569     return 2;
570 }
571 
572 
fatalfile()573 void fatalfile()
574 {
575     exit(printf("A file vital to the game cannot be loaded.  Please reset your machine and try   again"));
576 }
577 
showloading()578 void showloading()
579 {
580     wipetexttab();
581     showchatscreen();
582     message(88, 64, 0, 0, "Please Wait");
583     message(48, 128, 0, 0, "Loading Game files");
584     showtext();
585 }
586 
587 
filenotthere()588 void filenotthere()
589 {
590     showerror();
591     message(56, 64, 0, 0, "A file is missing.");
592     message(48, 96, 0, 0, "It cannot be loaded");
593     showtext();
594     errorwait();
595 }
596 
597 
filesyserror()598 void filesyserror()
599 {
600     showerrorok();
601     message(40, 64, 0, 0, "Unable to Load File");
602     message(56, 96, 0, 0, "Please Check Disc");
603     showtext();
604     errorwait();
605 }
606 
badload()607 void badload()
608 {
609     showerrorok();
610     message(32, 32, 0, 0, "A game file could not");
611     message(48, 64, 0, 0, "be loaded. Program");
612     message(80, 96, 0, 0, "Must exit now.");
613     showtext();
614     errorwait();
615     abort_game();
616 }
617 
badlevelload()618 int badlevelload()
619 {
620     showerrorok();
621     message(40, 32, 0, 0, "The level cannot be");
622     message(32, 64, 0, 0, "Loaded. Please check");
623     message(48, 96, 0, 0, "the disc, or press");
624     message(48, 128, 0, 0, "escape to end game.");
625     showtext();
626     return errorwait(); // 'clear carry if carry clear (???)'
627 }
628 
nomemory()629 void nomemory()
630 {
631     showerrorok();
632     message(48, 32, 0, 0, "There is not enough");
633     message(48, 64, 0, 0, "memory available to");
634     message(48, 96, 0, 0, "load the game files.");
635     showtext();
636     errorwait();
637 }
638 
showerror()639 void showerror()
640 {
641     //frameinc = 1;
642     showchatscreen();
643     swi_fastspr_clearwindow();
644     wipetexttab();
645     message(72, 200, 0, 0, "RET - Try Again");
646     message(72, 224, 0, 0, "ESC - Abandon");
647 }
648 
showerrorok()649 void showerrorok()
650 {
651     //frameinc = 1;
652     showchatscreen();
653     swi_fastspr_clearwindow();
654     wipetexttab();
655     message(72, 200, 0, 0, "RET - OK");
656     message(72, 224, 0, 0, "ESC - Abandon");
657 }
658 
errorwait()659 int errorwait()
660 {
661     if (osbyte_81(-74) != 0xff)
662        loopb9:
663         while (osbyte_81(-61) != 0xff)
664             if (swi_readescapestate())
665             {
666                 wipetexttab(); return 0;
667             }
668    waitover:
669     wipetexttab();
670     return 1;
671 }
672 
673 const char defscore[] = "00000000 PSY\n";
674 
setdefaultscores()675 void setdefaultscores()
676 {
677     char* r10 = highscorearea;
678 
679     for (int r3 = 5; r3 > 0; r3--)
680     {
681        loopd4:;
682         const char* r11 = defscore;
683         for (int r2 = 13; r2 > 0; r2--)
684            loopd5: *(r10++) = *(r11++);
685     }
686 }
687 
showhighscore()688 int showhighscore()
689 {
690     loadscores(highscorearea, options.mentalzone);
691     updatehst();
692     showhst();
693     message(96, 224, 0, 0, "press fire");
694     releaseclip();
695     showtext();
696     readopt(0);
697     return swi_readescapestate();
698 }
699 
updatehst()700 void updatehst()
701 {
702     hstindex = 5;
703     char* r10 = highscorearea;
704     r10 += 4*13; //4*entry length
705     while (comparescore(r10))
706     {
707        loopd1:
708         r10 -= 13; //entry length
709         if (--hstindex == 0) break;
710     }
711    lessthan:
712     r10 += 13; //entry length
713     if (hstindex != 5)
714     {
715         if (4-hstindex > 0)
716         {
717             char* r9;
718             int r3;
719             for (r9 = highscorearea+4*13-1, r3 = 13*(4-hstindex); r3 > 0; r9--, r3--)
720                loopd7:
721                 r9[13] = *r9;
722         }
723        noshiftscore:;
724 
725         char* r11 = plscore;
726         for (int r3 = 8; r3 > 0; r3--)
727            loopda:
728             *(r10++) = *(r11++)+'0';
729 
730         r10++;
731 //int r9=1024;
732 	key_state ks;
733         swi_blitz_wait(20); //
734         for (int i = 0; i < 3; i++) r10[i] = options.initials[i];
735         for (int r8 = 3; r8 > 0; r8--, r10++)
736         {
737             while (osbyte_81(0) != -options.firekey)
738             {
739                scorekeyloop:
740 //if (--r9<0) goto scoreexit;
741                 keyread(&ks);
742                 if (ks.leftpress == 0)
743                 {
744                     (*r10)++;
745                 }
746                 if (ks.rightpress == 0)
747                 {
748                     (*r10)--;
749                 }
750                 if (*r10 < '0') *r10 = '0';
751                 if (*r10 > 'Z'+4) *r10 = 'Z'+4;
752                 showhst();
753                 swi_blitz_wait(4);
754             }
755             options.initials[3-r8] = *r10;
756             swi_stasis_link(1, 18);
757             swi_stasis_volslide(1, 0, 0);
758             swi_sound_control(1, 0x17c, 140, 0);
759             /*if (r8>1)*/ swi_blitz_wait(20);
760         }
761        scoreexit:
762         savescores(highscorearea, options.mentalzone);
763         dosaveconf();
764     }
765    notontable:;
766 }
767 
768 
comparescore(char * r10)769 int comparescore(char* r10)
770 {
771     char* r11 = plscore;
772 
773     for (int r3 = 8; r3 > 0; r3--)
774     {
775        loopd0:
776         if (*r10-'0' < *r11) scoregreater: return 1;
777         else if (*r10-'0' > *r11) scoreless: return 0;
778         r10++; r11++;
779        compnext:;
780     }
781     return 1;
782 }
783 
showhst()784 void showhst()
785 {
786     swi_blitz_wait(0);
787     switchbank();
788     showchatscores();
789     wipetexttab();
790     message(64, 32, 0, 0, "Zone High Scores");
791 
792     int x = 32, y = 64, i, j;
793     char * ptr = highscorearea;
794     for (i = 0; i < 5; ++i)
795     {
796         char line[13];
797         for (j = 0; j < 12 && *ptr > 0xa; ++j, ++ptr)
798             line[j] = *ptr;
799         line[j] = 0;
800         message(x, y, 0, 0, line);
801         y += 32;
802         ++ptr; /*skip over newline*/
803     }
804     if (hstindex < 5)
805         message(280, (hstindex+2)<<5, 0, 0, "=");
806     texthandler(0);
807 }
808