|
|
| version 1.12, 2004/01/07 14:51:53 | version 1.23, 2005/03/23 13:43:36 |
|---|---|
| Line 10 | Line 10 |
| * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright |
| * notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the |
| * documentation and/or other materials provided with the distribution. | * 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 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| Line 47 | Line 45 |
| #include "sysmenu.h" | #include "sysmenu.h" |
| #include "toolwin.h" | #include "toolwin.h" |
| #include "viewer.h" | #include "viewer.h" |
| #include "debugwin.h" | |
| #include "skbdwin.h" | |
| #include "commng.h" | #include "commng.h" |
| #include "fontmng.h" | #include "fontmng.h" |
| Line 100 sighandler(int signo) | Line 100 sighandler(int signo) |
| static struct option longopts[] = { | static struct option longopts[] = { |
| { "config", required_argument, 0, 'c' }, | { "config", required_argument, 0, 'c' }, |
| { "timidity-config", required_argument, 0, 'C' }, | { "timidity-config", required_argument, 0, 'C' }, |
| { "shared-pixmap", no_argument, 0, 'p' }, | |
| #if defined(USE_SDL) || defined(USE_SYSMENU) | #if defined(USE_SDL) || defined(USE_SYSMENU) |
| { "ttfont", required_argument, 0, 't' }, | { "ttfont", required_argument, 0, 't' }, |
| #endif | #endif |
| Line 116 usage(void) | Line 115 usage(void) |
| printf("Usage: %s [options] [[FD1 image] [[FD2 image] [[FD3 image] [FD4 image]]]]\n\n", progname); | printf("Usage: %s [options] [[FD1 image] [[FD2 image] [[FD3 image] [FD4 image]]]]\n\n", progname); |
| printf("options:\n"); | printf("options:\n"); |
| printf("\t--help\n [-h] : print this message\n"); | printf("\t--help [-h] : print this message\n"); |
| printf("\t--config [-c] <file> : specify config file\n"); | printf("\t--config [-c] <file> : specify config file\n"); |
| printf("\t--timidity-config [-C] <file> : specify timidity config file\n"); | printf("\t--timidity-config [-C] <file> : specify timidity config file\n"); |
| printf("\t--shared-pixmap [-p] : use MIT-SHM pixmap extention\n"); | |
| #if defined(USE_SDL) || defined(USE_SYSMENU) | #if defined(USE_SDL) || defined(USE_SYSMENU) |
| printf("\t--ttfont [-t] <file> : specify TrueType font\n"); | printf("\t--ttfont [-t] <file> : specify TrueType font\n"); |
| #endif | #endif |
| Line 138 main(int argc, char *argv[]) | Line 136 main(int argc, char *argv[]) |
| int rv = 1; | int rv = 1; |
| int ch; | int ch; |
| int i, drvmax; | int i, drvmax; |
| BOOL shared_pixmap_flag = FALSE; | |
| progname = argv[0]; | progname = argv[0]; |
| Line 176 main(int argc, char *argv[]) | Line 173 main(int argc, char *argv[]) |
| milstr_ncpy(fontfilename, optarg, sizeof(fontfilename)); | milstr_ncpy(fontfilename, optarg, sizeof(fontfilename)); |
| break; | break; |
| case 'p': | |
| shared_pixmap_flag = TRUE; | |
| break; | |
| case 'h': | case 'h': |
| case '?': | case '?': |
| default: | default: |
| Line 247 main(int argc, char *argv[]) | Line 240 main(int argc, char *argv[]) |
| initload(); | initload(); |
| toolwin_readini(); | toolwin_readini(); |
| kdispwin_readini(); | kdispwin_readini(); |
| skbdwin_readini(); | |
| rand_setseed((SINT32)time(NULL)); | rand_setseed((SINT32)time(NULL)); |
| #if defined(__GNUC__) && (defined(i386) || defined(__i386__)) | #if defined(GCC_CPU_ARCH_IA32) |
| mmxflag = havemmx() ? 0 : MMXFLAG_NOTSUPPORT; | mmxflag = havemmx() ? 0 : MMXFLAG_NOTSUPPORT; |
| mmxflag += np2oscfg.disablemmx ? MMXFLAG_DISABLE : 0; | mmxflag += np2oscfg.disablemmx ? MMXFLAG_DISABLE : 0; |
| #endif | #endif |
| use_shared_pixmap = np2oscfg.shared_pixmap && shared_pixmap_flag; | use_shared_pixmap = np2oscfg.shared_pixmap; |
| TRACEINIT(); | TRACEINIT(); |
| Line 264 main(int argc, char *argv[]) | Line 258 main(int argc, char *argv[]) |
| kdispwin_initialize(); | kdispwin_initialize(); |
| viewer_init(); | viewer_init(); |
| skbdwin_initialize(); | |
| toolkit_widget_create(); | toolkit_widget_create(); |
| scrnmng_initialize(); | scrnmng_initialize(); |
| kbdmng_init(); | kbdmng_init(); |
| inputmng_init(); | inputmng_init(); |
| keystat_reset(); | keystat_initialize(); |
| scrnmode = 0; | scrnmode = 0; |
| if (np2cfg.RASTER) { | if (np2cfg.RASTER) { |
| Line 298 main(int argc, char *argv[]) | Line 293 main(int argc, char *argv[]) |
| } | } |
| } | } |
| joymng_initialize(); | |
| mousemng_initialize(); | mousemng_initialize(); |
| if (np2oscfg.MOUSE_SW) { | if (np2oscfg.MOUSE_SW) { |
| mouse_running(MOUSE_ON); | mouse_running(MOUSE_ON); |
| Line 307 main(int argc, char *argv[]) | Line 303 main(int argc, char *argv[]) |
| sysmng_initialize(); | sysmng_initialize(); |
| taskmng_initialize(); | taskmng_initialize(); |
| joy_init(); | |
| pccore_init(); | pccore_init(); |
| S98_init(); | S98_init(); |
| Line 323 main(int argc, char *argv[]) | Line 318 main(int argc, char *argv[]) |
| if (np2oscfg.keydisp) { | if (np2oscfg.keydisp) { |
| kdispwin_create(); | kdispwin_create(); |
| } | } |
| if (np2oscfg.softkbd) { | |
| skbdwin_create(); | |
| } | |
| } | } |
| #if !defined(CPUCORE_IA32) | |
| if (np2oscfg.resume) { | if (np2oscfg.resume) { |
| flagload(np2resumeext, "Resume", FALSE); | flagload(np2resumeext, "Resume", FALSE); |
| } | } |
| #endif | |
| sysmng_workclockreset(); | sysmng_workclockreset(); |
| drvmax = (argc < 4) ? argc : 4; | drvmax = (argc < 4) ? argc : 4; |
| for (i = 0; i < drvmax; i++) { | for (i = 0; i < drvmax; i++) { |
| milstr_ncpy(diskdrv_fname[i],argv[i],sizeof(diskdrv_fname[0])); | diskdrv_readyfdd(i, argv[i], 0); |
| diskdrv_delay[i] = 1; | |
| } | } |
| setup_signal(SIGINT, sighandler); | setup_signal(SIGINT, sighandler); |
| Line 344 main(int argc, char *argv[]) | Line 343 main(int argc, char *argv[]) |
| kdispwin_destroy(); | kdispwin_destroy(); |
| toolwin_destroy(); | toolwin_destroy(); |
| skbdwin_destroy(); | |
| pccore_cfgupdate(); | pccore_cfgupdate(); |
| mouse_running(MOUSE_OFF); | mouse_running(MOUSE_OFF); |
| joymng_deinitialize(); | |
| S98_trash(); | S98_trash(); |
| #if !defined(CPUCORE_IA32) | |
| if (np2oscfg.resume) { | if (np2oscfg.resume) { |
| flagsave(np2resumeext); | flagsave(np2resumeext); |
| } else { | } else { |
| flagdelete(np2resumeext); | flagdelete(np2resumeext); |
| } | } |
| #endif | |
| pccore_term(); | pccore_term(); |
| debugwin_destroy(); | |
| soundmng_deinitialize(); | soundmng_deinitialize(); |
| scrnmng_destroy(); | scrnmng_destroy(); |
| Line 372 fontmng_failure: | Line 376 fontmng_failure: |
| initsave(); | initsave(); |
| toolwin_writeini(); | toolwin_writeini(); |
| kdispwin_writeini(); | kdispwin_writeini(); |
| skbdwin_writeini(); | |
| } | } |
| skbdwin_deinitialize(); | |
| TRACETERM(); | TRACETERM(); |
| dosio_term(); | dosio_term(); |