--- np2/x11/main.c 2004/07/26 15:53:26 1.20 +++ np2/x11/main.c 2008/03/13 16:27:39 1.28 @@ -10,8 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -44,7 +42,6 @@ #include "toolkit.h" #include "kdispwin.h" -#include "sysmenu.h" #include "toolwin.h" #include "viewer.h" #include "debugwin.h" @@ -52,7 +49,6 @@ #include "commng.h" #include "fontmng.h" -#include "inputmng.h" #include "joymng.h" #include "kbdmng.h" #include "mousemng.h" @@ -63,12 +59,6 @@ /* - * resume - */ -static const char np2resumeext[] = "sav"; - - -/* * failure signale handler */ typedef void sigfunc(int); @@ -102,9 +92,6 @@ sighandler(int signo) static struct option longopts[] = { { "config", required_argument, 0, 'c' }, { "timidity-config", required_argument, 0, 'C' }, -#if defined(USE_SDL) || defined(USE_SYSMENU) - { "ttfont", required_argument, 0, 't' }, -#endif { "help", no_argument, 0, 'h' }, { 0, 0, 0, 0 }, }; @@ -120,9 +107,6 @@ usage(void) printf("\t--help [-h] : print this message\n"); printf("\t--config [-c] : specify config file\n"); printf("\t--timidity-config [-C] : specify timidity config file\n"); -#if defined(USE_SDL) || defined(USE_SYSMENU) - printf("\t--ttfont [-t] : specify TrueType font\n"); -#endif exit(1); } @@ -144,7 +128,7 @@ main(int argc, char *argv[]) toolkit_initialize(); toolkit_arginit(&argc, &argv); - while ((ch = getopt_long(argc, argv, "c:C:t:ph", longopts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "c:C:t:vh", longopts, NULL)) != -1) { switch (ch) { case 'c': if (stat(optarg, &sb) < 0 || !S_ISREG(sb.st_mode)) { @@ -175,6 +159,10 @@ main(int argc, char *argv[]) milstr_ncpy(fontfilename, optarg, sizeof(fontfilename)); break; + case 'v': + verbose = 1; + break; + case 'h': case '?': default: @@ -246,12 +234,8 @@ main(int argc, char *argv[]) rand_setseed((SINT32)time(NULL)); -#if defined(GCC_CPU_ARCH_IA32) mmxflag = havemmx() ? 0 : MMXFLAG_NOTSUPPORT; mmxflag += np2oscfg.disablemmx ? MMXFLAG_DISABLE : 0; -#endif - - use_shared_pixmap = np2oscfg.shared_pixmap; TRACEINIT(); @@ -265,22 +249,19 @@ main(int argc, char *argv[]) toolkit_widget_create(); scrnmng_initialize(); kbdmng_init(); - inputmng_init(); keystat_initialize(); scrnmode = 0; if (np2cfg.RASTER) { scrnmode |= SCRNMODE_HIGHCOLOR; } - if (sysmenu_create() != SUCCESS) - goto sysmenu_failure; if (scrnmng_create(scrnmode) != SUCCESS) goto scrnmng_failure; if (soundmng_initialize() == SUCCESS) { result = soundmng_pcmload(SOUND_PCMSEEK, file_getcd("fddseek.wav")); if (!result) { - result = soundmng_pcmload(SOUND_PCMSEEK, SYSRESPATH "/wav/fddseek.wav"); + result = soundmng_pcmload(SOUND_PCMSEEK, SYSRESPATH "/fddseek.wav"); } if (result) { soundmng_pcmvolume(SOUND_PCMSEEK, np2cfg.MOTORVOL); @@ -288,7 +269,7 @@ main(int argc, char *argv[]) result = soundmng_pcmload(SOUND_PCMSEEK1, file_getcd("fddseek1.wav")); if (!result) { - result = soundmng_pcmload(SOUND_PCMSEEK1, SYSRESPATH "/wav/fddseek1.wav"); + result = soundmng_pcmload(SOUND_PCMSEEK1, SYSRESPATH "/fddseek1.wav"); } if (result) { soundmng_pcmvolume(SOUND_PCMSEEK1, np2cfg.MOTORVOL); @@ -325,15 +306,16 @@ main(int argc, char *argv[]) } } +#if defined(SUPPORT_RESUME) if (np2oscfg.resume) { flagload(np2resumeext, "Resume", FALSE); } +#endif sysmng_workclockreset(); drvmax = (argc < 4) ? argc : 4; for (i = 0; i < drvmax; i++) { - milstr_ncpy(diskdrv_fname[i],argv[i],sizeof(diskdrv_fname[0])); - diskdrv_delay[i] = 1; + diskdrv_readyfdd(i, argv[i], 0); } setup_signal(SIGINT, sighandler); @@ -352,11 +334,13 @@ main(int argc, char *argv[]) joymng_deinitialize(); S98_trash(); +#if !defined(CPUCORE_IA32) if (np2oscfg.resume) { flagsave(np2resumeext); } else { flagdelete(np2resumeext); } +#endif pccore_term(); debugwin_destroy(); @@ -365,9 +349,6 @@ main(int argc, char *argv[]) scrnmng_destroy(); scrnmng_failure: - sysmenu_destroy(); - -sysmenu_failure: fontmng_terminate(); fontmng_failure: