home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <signal.h>
- #include "oslib/wimp.h"
- #include "oslib/osargs.h"
- #include "oslib/osfind.h"
- #include "oslib/osgbpb.h"
- #include "oslib/osmodule.h"
- #include "oslib/taskmanager.h"
- #include "manic.h"
- #include "gfxdata/gfxdata.h"
- #include "gfxlibs/keyboard.h"
- #include "ROsupport.h"
- #include "ROsound.h"
- #include "kernel.h"
- #ifdef UNIXLIB
- # include "unistd.h"
- #endif
-
- #define DEFAULTSPEED 3
- #define DEFAULTMUSIC 0
- #define DEFAULTRES (machinetype>1)
- #define DEFAULTPAUSE 0
- #define DEFAULTSOUND (SOUNDdefault[machinetype])
- #define DEFAULTVOLUME 100
-
-
- #define TASKNAME "Manic Miner"
- #define TASKNAMELEN 11
-
-
- static void
- report (const os_error * err)
- {
- if (err)
- wimp_report_error (err, wimp_ERROR_BOX_OK_ICON, TASKNAME);
- }
-
-
- static void
- reportmsg (const char *msg)
- {
- if (msg) {
- os_error err;
- err.errnum = 0;
- strcpy (err.errmess, msg);
- report (&err);
- }
- }
-
-
- static void
- x (const os_error * err)
- {
- if (err) {
- report (err);
- exit (1);
- }
- }
-
-
- static int open = 0, quit = 0, notme = 0, easteregg = 0;
- static int ibar_icon;
- static os_t eggtimer;
- static wimp_icon_flags eggflags;
- static char eggpaint[6];
- extern const BYTE *const mm_anim;
-
-
- static void
- closetemplate (void)
- {
- if (open)
- xwimp_close_template ();
- open = 0;
- }
-
-
- static wimp_w
- loadt (const char *template)
- {
- int used, data_used, context;
- wimp_window *w_raw;
- char tempname[13] = "";
- char *data;
- wimp_w w_handle;
-
- strncpy (tempname, template, 12);
- x (xwimp_load_template (
- (wimp_window *) (-1), 0, 0, (byte *) (-1),
- tempname, 0, &used, &data_used, &context)
- );
- if (!context) {
- os_error err;
- err.errnum = 0;
- sprintf (err.errmess, "Template %s not found", template);
- xwimp_close_template ();
- x (&err);
- }
- w_raw = malloc (used);
- data = malloc (data_used);
- if (w_raw == 0 || data == 0) {
- reportmsg ("malloc failed");
- xwimp_close_template ();
- exit (1);
- }
- x (xwimp_load_template
- (w_raw, data, data + data_used, (byte *) (-1), tempname, 0, &used,
- &data_used, &context)
- );
- x (xwimp_create_window (w_raw, &w_handle));
- free (w_raw);
- return w_handle;
- }
-
-
- int wimp_v;
-
- static const int msgs[] = {
- message_DATA_SAVE, message_DATA_LOAD,
- message_PREQUIT, message_TASK_INITIALISE, message_MENU_WARNING,
- message_MENUS_DELETED, 0x4AF80, 0x4E383, 0
- };
-
- static wimp_block poll;
- static wimp_t task_h;
- static wimp_w infobox, optsbox;
-
- static char *name_buf, *vol_buf;
-
- static wimp_icon_create icon = {
- (wimp_w) - 1,
- {{0, 0, 40, 72}, 0x1700311A, ""}
- };
-
- static char sprite[] = "!manic";
-
-
- static const wimp_MENU (2) loadmenu =
- {
- {"Level files"}, 7, 2, 7, 0, 192, 44, 0,
- {
- {0, 0, 0x07000021, {"Standard"}},
- {128, 0, 0x07000021, {"Blood!"}},
- }
- };
-
-
- static wimp_MENU (5) menu[2] =
- {
- {
- {TASKNAME}, 7, 2, 7, 0, 160, 44, 0,
- {
- {8, 0, 0x07000021, {"Info"}},
- {0, 0, 0x07000021, {"Play"}},
- {8, 0, 0x07000021, {"Choices..."}},
- {0, (wimp_menu *) &loadmenu, 0x07000021, {"Load"}},
- {128, 0, 0x07000021, {"Quit"}},
- }
- },
- {
- {TASKNAME}, 7, 2, 7, 0, 160, 44, 0,
- {
- {8, 0, 0x07000021, {"Info"}},
- {0, 0, 0x07000021, {"Resume"}},
- {8, 0, 0x07000021, {"Choices..."}},
- {0, (wimp_menu *) &loadmenu, 0x07400021, {"Load"}},
- {128, 0, 0x07000021, {"Quit"}},
- }
- }
- };
-
- /*
- static const struct
- {
- const char *read;
- const char *write;
- }
- choicesfile[2] =
- {
- {"Choices:ManicMiner", "<Choices$Write>.ManicMiner"}, ** Default **
- {"<Manic$Dir>.Choices", "<Manic$Dir>.Choices"} ** Fallback **
- };
-
- static BYTE choicesnum = 0;*/
-
- static BYTE SPEED_l, MUSIC_l, HIRES_l, PAUSE_l, SOUND_l;
- static int VOLUME_l;
-
- static const BYTE SOUNDdefault[] = { 2, 4, 5, 9 };
-
- /*
- static void
- setDefaults (void)
- {
- SPEED = DEFAULTSPEED;
- MUSICtype = DEFAULTMUSIC;
- VidMode = DEFAULTRES;
- PAUSEtype = DEFAULTPAUSE;
- SOUND = DEFAULTSOUND;
- VOLUME = DEFAULTVOLUME;
- }
- */
-
- static void
- select (int icon, int state)
- {
- xwimp_set_icon_state (optsbox, icon, state ? 1 << 21 : 0, 1 << 21);
- }
-
- /*
- static void
- shade (int icon, int state)
- {
- xwimp_set_icon_state (optsbox, icon, state ? 0 : 1 << 22, 1 << 22);
- }
- */
-
- static void
- copy_opts (void)
- {
- SPEED_l = SPEED;
- MUSIC_l = MUSICtype;
- HIRES_l = VidMode;
- PAUSE_l = PAUSEtype;
- SOUND_l = SOUND;
- VOLUME_l = VOLUME;
- }
-
-
- static void
- reflect_volume (void)
- {
- sprintf (vol_buf, "%i", VOLUME_l);
- select (32, 0);
- }
-
-
- static void
- reflect_levels (void)
- {
- strcpy (name_buf, LEVELSNAME);
- select (10, 0);
- }
-
-
- static void
- reflect_game (void)
- {
- sprite[0] = (MODE == 2) ? '#' : '!';
- xwimp_set_icon_state ((wimp_w) -2, ibar_icon, 0, 0);
- }
-
-
- static void
- reflect_opts (void)
- {
- select (2, SPEED_l == 4);
- select (3, SPEED_l == 3);
- select (4, SPEED_l == 2);
- select (5, SPEED_l == 1);
- select (6, SPEED_l == 0);
- select (13, MUSIC_l);
- select (14, !MUSIC_l);
- select (17, HIRES_l);
- select (18, !HIRES_l);
- select (22, PAUSE_l);
- select (25, (SOUND_l >> 2) == 0);
- select (26, (SOUND_l >> 2) == 1);
- select (27, (SOUND_l >> 2) == 2);
- select (28, SOUND_l & 1);
- select (29, SOUND_l & 2);
- reflect_volume ();
- }
-
-
- static void
- openopts (void)
- {
- wimp_window_state w;
- int x, y, z;
-
- copy_opts ();
- reflect_opts ();
- os_read_mode_variable ((os_mode) (-1), 11, &x);
- os_read_mode_variable ((os_mode) (-1), 4, &z);
- x = (x + 1) << z;
- os_read_mode_variable ((os_mode) (-1), 12, &y);
- os_read_mode_variable ((os_mode) (-1), 5, &z);
- y = (y + 1) << z;
- w.w = optsbox;
- wimp_get_window_state (&w);
- w.visible.x1 -= w.visible.x0;
- w.visible.y1 -= w.visible.y0;
- w.visible.x0 = (x - w.visible.x1) / 2;
- w.visible.y0 = (y - w.visible.y1) / 2;
- w.visible.x1 += w.visible.x0;
- w.visible.y1 += w.visible.y0;
- w.next = (wimp_w) (-1);
- w.flags |= 1 << 24;
- openwindow (&w);
- }
-
-
- static void
- close_opts (void)
- {
- wimp_create_menu ((wimp_menu *) (-1), 0, 0);
- wimp_close_window (optsbox);
- }
-
-
- #define X(m) { const char *foo; foo=m; if (foo) { godesktop(); return foo; }}
- void (X)(const char* msg);
-
-
- static const char *
- main_singletask ()
- {
- modedata[0] = -1;
- if (!sampleptr[0].ptr)
- X (loadSamples ());
- if (initmusic (SOUND & 2 ? 0 : "<Manic$Dir>.snddata.manic/xm"))
- X ("Failed to load the music");
- if (initsfx (SOUND & 2))
- X ("Failed to initialise the sound effects");
- X (Initialise ());
- X (SelMode (VidMode));
- mm_gfx_palset (PALmain);
- if (MODE == 2) {
- DrawLevel();
- mm_gfx_flush ();
- StartGameMusic();
- if (MUSICon && PAUSEtype) musicPause(0);
- }
- mainloop ();
- if (MODE != 2) {
- MODE = 0;
- TITLEm = 0;
- }
- godesktop ();
- return 0;
- }
-
-
- static void
- rungame (void)
- {
- if (MODE == 255) {
- reportmsg ("You must load a valid levels file first.");
- return;
- }
- reportmsg (main_singletask ());
- copy_opts ();
- reflect_opts ();
- reflect_game ();
- }
-
-
- static void
- urlDispatch (const char *url)
- {
- wimp_message msg;
- msg.size = 256;
- msg.your_ref = 0;
- msg.action = 0x4AF80;
- strcpy ((char *) msg.data.reserved, url);
- x (xwimp_send_message (wimp_USER_MESSAGE_RECORDED, &msg, 0));
- }
-
-
- static void
- launch (const char *url)
- {
- wimp_t i;
- if (!module_present ("AcornURI"))
- xwimp_start_task ("/System:Modules.Network.URI", &i);
- if (module_present ("AcornURI"))
- uriDispatch (url, task_h);
- else
- urlDispatch (url);
- }
-
-
- static void
- stop_easteregg (void)
- {
- if (easteregg == 4) {
- xwimp_delete_icon (infobox, 11);
- xwimp_delete_icon (infobox, 12);
- xwimp_set_icon_state (infobox, 0, eggflags, -1);
- }
- easteregg = 0;
- }
-
-
- static void
- do_easteregg (void)
- {
- os_t t;
- strcpy (eggpaint, eggpaint[1] == 'a' ? "miner" : "manic");
- wimp_set_icon_state (infobox, 12, 0, 0);
- t = os_read_monotonic_time ();
- do {
- eggtimer += 50;
- } while (eggtimer <= t);
- }
-
-
- static BYTE
- iconState (int icon)
- {
- wimp_icon_state i;
- i.w = optsbox;
- i.i = icon;
- xwimp_get_icon_state (&i);
- return i.icon.flags >> 21 & 1;
- }
-
-
- static void
- go_loadgame (const char *file)
- {
- switch (loadgame (file)) {
- case 0: /* loaded OK */
- poll.message.size = 256;
- poll.message.your_ref = poll.message.my_ref;
- poll.message.action = message_DATA_SAVE_ACK;
- poll.message.data.data_xfer.est_size = -1;
- xwimp_send_message (wimp_USER_MESSAGE,
- &poll.message, poll.message.sender);
- reflect_levels ();
- MODE = 0;
- break;
- case 1: /* wrong ID */
- reportmsg ("This is not a valid MM levels file");
- MODE = 0;
- break;
- case 2: /* couldn't open the file */
- report ((const os_error *) _kernel_last_oserror ());
- MODE = 0;
- break;
- case 3: /* partially read file :-( */
- default:
- report ((const os_error *) _kernel_last_oserror ());
- strcpy (LEVELSNAME, "– None –");
- reflect_levels ();
- MODE = 255;
- break;
- }
- reflect_game ();
- }
-
- static void
- click (void)
- {
- int i;
-
- if (poll.pointer.w == (wimp_w) (-2)) {
- switch (poll.pointer.buttons) {
- case 4:
- rungame ();
- break;
- case 2:
- x (xwimp_create_menu ((wimp_menu *) (&menu[MODE == 2]),
- poll.pointer.pos.x - 64, 316));
- break;
- case 1:
- openopts ();
- }
- }
- else if (poll.pointer.w == infobox) {
- if ((poll.pointer.buttons & 2) == 0) {
- switch (poll.pointer.i) {
- case 9:
- launch ("mailto:ds@youmustbejoking.demon.co.uk");
- break;
- case 10:
- launch ("http://www.youmustbejoking.demon.co.uk/");
- break;
- }
- }
- else {
- if (poll.pointer.i == 0 && easteregg < 4 && ++easteregg == 4) {
- wimp_icon_state icn;
- wimp_icon_create new;
- new.w = icn.w = infobox;
- icn.i = 0;
- xwimp_get_icon_state (&icn);
- eggflags = icn.icon.flags;
- memcpy (&new.icon.extent, &icn.icon.extent, sizeof (icn.icon.extent));
- new.icon.flags = 0x17000105;
- new.icon.data.indirected_text.text = "";
- new.icon.data.indirected_text.validation = "R2";
- new.icon.data.indirected_text.size = 1;
- xwimp_create_icon (&new, &ibar_icon);
- new.icon.extent.x0 += 4;
- new.icon.extent.y0 += 4;
- new.icon.extent.x1 -= 4;
- new.icon.extent.y1 -= 4;
- new.icon.flags = 0x7700013A;
- new.icon.data.indirected_sprite.id = (osspriteop_id) eggpaint;
- new.icon.data.indirected_sprite.area =
- (osspriteop_area *) (mm_anim - 4);
- new.icon.data.indirected_sprite.size = 6;
- strcpy (eggpaint, "manic");
- xwimp_create_icon (&new, &i);
- xwimp_set_icon_state (infobox, 0, 0, -1);
- eggtimer = os_read_monotonic_time () + 50;
- }
- }
- }
- else if (poll.pointer.w == optsbox) {
- if ((poll.pointer.buttons & 2) == 0) {
- switch (poll.pointer.i) {
- case 2: /* speed = boring */
- case 3: /* speed = original */
- case 4: /* speed = 1997 */
- case 5: /* speed = hard */
- case 6: /* speed = silly */
- SPEED_l = 6 - poll.pointer.i;
- select (poll.pointer.i, 1);
- break;
- case 13: /* music = original */
- case 14: /* music = 1997 */
- MUSIC_l = 14 - poll.pointer.i;
- select (poll.pointer.i, 1);
- break;
- case 17: /* resolution = high */
- case 18: /* resolution = low */
- HIRES_l = 18 - poll.pointer.i;
- select (poll.pointer.i, 1);
- break;
- case 22:
- PAUSE_l = iconState (22);
- break;
- case 25: /* sound quality = low */
- case 26: /* sound quality = medium */
- case 27: /* sound quality = high */
- SOUND_l = (poll.pointer.i - 25) << 2 | (SOUND_l & 3);
- select (poll.pointer.i, 1);
- break;
- case 28: /* interpolated? */
- SOUND_l = iconState (28) | (SOUND_l & ~1);
- break;
- case 29: /* off? */
- SOUND_l = iconState (29) << 1 | (SOUND_l & ~2);
- break;
- case 19: /* cancel */
- if (poll.pointer.buttons == 4)
- close_opts ();
- else {
- copy_opts ();
- reflect_opts ();
- }
- break;
- case 20: /* ok */
- SPEED = SPEED_l;
- MUSICtype = MUSIC_l;
- VidMode = HIRES_l;
- PAUSEtype = PAUSE_l;
- SOUND = SOUND_l;
- VOLUME = VOLUME_l;
- if (mm_keyb_pressed (131))
- HISCORE = 0;
- if (poll.pointer.buttons & 4)
- close_opts ();
- break;
- case 21: /* save */
- SPEED = SPEED_l;
- MUSICtype = MUSIC_l;
- VidMode = HIRES_l;
- PAUSEtype = PAUSE_l;
- SOUND = SOUND_l;
- VOLUME = VOLUME_l;
- if (mm_keyb_pressed (131))
- HISCORE = 0;
- if (poll.pointer.buttons & 4)
- close_opts ();
- SaveInfo (1);
- break;
- case 30: /* defaults */
- SPEED_l = DEFAULTSPEED;
- MUSIC_l = DEFAULTMUSIC;
- HIRES_l = DEFAULTRES;
- PAUSE_l = DEFAULTPAUSE;
- SOUND_l = DEFAULTSOUND;
- VOLUME_l = DEFAULTVOLUME;
- reflect_opts ();
- break;
- case 33:
- case 34:
- i = mm_keyb_pressed (129) ? 10 : 1;
- if ((poll.pointer.i ^ poll.pointer.buttons) & 1) {
- if (VOLUME_l > 0) {
- VOLUME_l -= i;
- if (VOLUME_l < 0)
- VOLUME_l = 0;
- reflect_volume ();
- }
- }
- else {
- if (VOLUME_l < 100) {
- VOLUME_l += i;
- if (VOLUME_l > 100)
- VOLUME_l = 100;
- reflect_volume ();
- }
- }
- }
- }
- }
- }
-
-
- static void
- menuclick (void)
- {
- switch (poll.selection.items[0]) {
- case 1:
- rungame ();
- break;
- case 2:
- openopts ();
- break;
- case 3:
- switch (poll.selection.items[1]) {
- case 0:
- go_loadgame ("<Manic$Dir>.set0/lev");
- break;
- case 1:
- go_loadgame ("<Manic$Dir>.set1/lev");
- break;
- }
- break;
- case 4:
- quit = (MODE == 2) ? areyousure (0) : 1;
- }
- if (xwimp_get_pointer_info (&poll.pointer))
- return;
- if (poll.pointer.buttons == 1)
- wimp_create_menu ((wimp_menu *) (&menu), 0, 0);
- }
-
-
- static void
- message (void)
- {
- switch (poll.message.action) {
- case 0:
- xwimp_close_down (task_h);
- quit = 1;
- break;
- case message_DATA_SAVE:
- if (poll.message.data.data_xfer.file_type != 0xFFD)
- break;
- poll.message.size = 256;
- poll.message.your_ref = poll.message.my_ref;
- poll.message.action = message_DATA_SAVE_ACK;
- poll.message.data.data_xfer.est_size = -1;
- strcpy (poll.message.data.data_xfer.file_name, "<Wimp$Scrap>");
- xwimp_send_message (wimp_USER_MESSAGE,
- &poll.message, poll.message.sender);
- break;
- case message_DATA_LOAD:
- if (poll.message.data.data_xfer.file_type != 0xFFD)
- break;
- if (MODE == 2 && !areyousure (1))
- break;
- go_loadgame (poll.message.data.data_xfer.file_name);
- break;
- case message_PREQUIT:
- if (MODE == 2 && !areyousure (0)) {
- poll.message.your_ref = poll.message.my_ref;
- xwimp_send_message (wimp_USER_MESSAGE,
- &poll.message, poll.message.sender);
- }
- break;
- case message_TASK_INITIALISE:
- if (poll.message.sender == task_h)
- notme = 1;
- else if (notme) {
- os_error *err;
- char *name;
- err = xtaskmanager_task_name_from_handle (poll.message.sender, &name);
- if (!memcmp (name, TASKNAME, TASKNAMELEN) && name[TASKNAMELEN] < 32) {
- poll.message.size = 20;
- poll.message.my_ref = 0;
- poll.message.action = message_QUIT;
- xwimp_send_message (wimp_USER_MESSAGE,
- &poll.message, poll.message.sender);
- }
- }
- break;
- case message_MENU_WARNING:
- {
- wimp_message_menu_warning *m =
- (wimp_message_menu_warning *) poll.message.data.reserved;
- switch (m->selection.items[0]) {
- case 0:
- stop_easteregg ();
- goto opensub;
- case 2:
- copy_opts ();
- reflect_opts ();
- opensub:wimp_create_sub_menu (m->sub_menu, m->pos.x, m->pos.y);
- if (m->sub_menu == (wimp_menu *) optsbox) {
- wimp_window_state w;
- w.w = optsbox;
- if (xwimp_get_window_state (&w))
- break;
- w.flags &= ~(1 << 24);
- openwindow (&w);
- }
- }
- }
- break;
- case message_MENUS_DELETED:
- stop_easteregg ();
- break;
- case 0x4E383:
- if (poll.message.data.reserved[0] & 1) {
- char url[256];
- url[0] = 0;
- uriRequest (url, 256, ((int *) poll.message.data.reserved)[1]);
- if (url[0]) {
- urlDispatch (url);
- }
- }
- break;
- }
- }
-
-
- static void
- bounce (void)
- {
- if (poll.message.action == 0x4AF80) {
- wimp_t t = 0;
- const char *i, *url;
- static char tmp[256] = "Alias$URLOpen_"; /* len=14 */
- i = strchr (url = (char *) poll.message.data.reserved, ':');
- if (!i)
- return;
- strncpy (tmp + 14, url, i - url);
- if (!getenv (tmp))
- return;
- strcat (tmp, " ");
- strcat (tmp, url);
- xwimp_start_task (tmp + 6, &t);
- }
- }
-
-
- typedef void (*SIGNAL) (int);
-
- void
- desktop (void)
- {
- int i;
-
- #ifdef UNIXLIB
- __uname_control = __UNAME_NO_PROCESS;
- #endif
-
- modedata[0] = -1;
- signal (SIGABRT, (SIGNAL) goshutdown);
- signal (SIGFPE, (SIGNAL) goshutdown);
- signal (SIGILL, (SIGNAL) goshutdown);
- signal (SIGINT, (SIGNAL) goshutdown);
- signal (SIGSEGV, (SIGNAL) goshutdown);
- signal (SIGTERM, (SIGNAL) goshutdown);
- #ifdef SIGSTAK
- signal (SIGSTAK, (SIGNAL) goshutdown);
- #endif
- #ifdef SIGOSERROR
- signal (SIGOSERROR, (SIGNAL) goshutdown);
- #endif
-
- // if (!getenv ("Choices$Write"))
- // choicesnum = 1;
- findMachineType ();
- task_h =
- wimp_initialise (310, TASKNAME, (wimp_message_list *) msgs, &wimp_v);
- do {
- x (xwimp_poll (0x00003933, &poll, 0, &i));
- if (i == wimp_USER_MESSAGE || i == wimp_USER_MESSAGE_RECORDED)
- message ();
- }
- while (!quit && !notme);
- if (quit)
- exit (0);
-
- wimp_open_template ("<Manic$Dir>.Templates");
- open = 1;
- atexit (closetemplate);
- menu[0].entries[0].sub_menu =
- menu[1].entries[0].sub_menu = (wimp_menu *) (infobox = loadt ("Info"));
- menu[0].entries[2].sub_menu =
- menu[1].entries[2].sub_menu = (wimp_menu *) (optsbox = loadt ("Options"));
- {
- wimp_icon_state i;
- i.w = infobox;
- i.i = 3;
- x (xwimp_get_icon_state (&i));
- strcpy (i.icon.data.indirected_text.text, VERSION);
- i.w = optsbox;
- i.i = 10;
- x (xwimp_get_icon_state (&i));
- name_buf = i.icon.data.indirected_text.text;
- i.i = 32;
- x (xwimp_get_icon_state (&i));
- vol_buf = i.icon.data.indirected_text.text;
- }
- closetemplate ();
- icon.icon.data.indirected_sprite.id = (osspriteop_id) sprite;
- icon.icon.data.indirected_sprite.area = (osspriteop_area *) 1;
- icon.icon.data.indirected_sprite.size = 7;
- x (xwimp_create_icon (&icon, &ibar_icon));
- atexit (goshutdown);
- LoadInfo ();
- reflect_levels ();
- do {
- if (easteregg == 4)
- x (xwimp_poll_idle (0x00003932, &poll, eggtimer, 0, &i));
- else
- x (xwimp_poll (0x00003933, &poll, 0, &i));
- switch (i) {
- case wimp_NULL_REASON_CODE:
- do_easteregg ();
- break;
- case wimp_OPEN_WINDOW_REQUEST:
- xwimp_open_window (&poll.open);
- break;
- case wimp_CLOSE_WINDOW_REQUEST:
- xwimp_close_window (poll.close.w);
- break;
- case wimp_MOUSE_CLICK:
- click ();
- break;
- case wimp_MENU_SELECTION:
- menuclick ();
- break;
- case wimp_USER_MESSAGE:
- case wimp_USER_MESSAGE_RECORDED:
- message ();
- break;
- case wimp_USER_MESSAGE_ACKNOWLEDGE:
- bounce ();
- break;
- }
- } while (!quit);
- xwimp_close_down (task_h);
- SaveInfo ();
- exit (0);
- }
-