Esempio n. 1
0
int wiimenu_do_option_selection(int opt)
{
	UINT32 update = 0;
	switch(opt) {
		case 0:
			np2oscfg.DRAW_SKIP++;
			np2oscfg.DRAW_SKIP %= 5;
			return 1;
		case 1:
			np2oscfg.NOWAIT ^= 1;
			return 2;
		case 2:
			np2cfg.KEY_MODE++;
			np2cfg.KEY_MODE %= 4;
			keystat_resetjoykey();
			update |= SYS_UPDATECFG;
			sysmng_update(update);
			return 3;
		case 3:
			wiimenu_sound_cfg();
			return 4;
		case 4:
			switch(np2cfg.EXTMEM) {
				case 7:
					np2cfg.EXTMEM = 0;
					break;
				case 3:
					np2cfg.EXTMEM += 2;
				case 1:
					np2cfg.EXTMEM++;
				case 0:
					np2cfg.EXTMEM++;
					break;
			}
			return 5;
		case 5:
			rs232c_midipanic();
			mpu98ii_midipanic();
			pc9861k_midipanic();
			return 6;
		case 6:
			wiimenu_dip_cfg();
			return 0;
		default:
			return -1;
	}
}
Esempio n. 2
0
int statsave_load(const OEMCHAR *filename) {

	SFFILEH		sffh;
	int			ret;
	BOOL		done;
const SFENTRY	*tbl;
const SFENTRY	*tblterm;

	sffh = statflag_open(filename, NULL, 0);
	if (sffh == NULL) {
		return(STATFLAG_FAILURE);
	}

	// PCCORE read!
	ret = statflag_readsection(sffh);
	if ((ret != STATFLAG_SUCCESS) ||
		(memcmp(sffh->sfh.hdr.index, np2tbl[0].index, sizeof(sffh->sfh.hdr.index)))) {
		statflag_close(sffh);
		return(STATFLAG_FAILURE);
	}

	soundmng_stop();
	rs232c_midipanic();
	mpu98ii_midipanic();
	pc9861k_midipanic();
	sxsi_alltrash();

	ret |= flagload_common(&sffh->sfh, np2tbl);

	CPU_RESET();
	CPU_SETEXTSIZE((UINT32)pccore.extmem);
	nevent_allreset();

	sound_changeclock();
	beep_changeclock();
	sound_reset();
	fddmtrsnd_bind();

	iocore_reset(&np2cfg);							// サウンドでpicを呼ぶので…
	cbuscore_reset(&np2cfg);
	fmboard_reset(&np2cfg, pccore.sound);

	done = FALSE;
	while((!done) && (ret != STATFLAG_FAILURE)) {
		ret |= statflag_readsection(sffh);
		tbl = np2tbl + 1;
		tblterm = np2tbl + NELEMENTS(np2tbl);
		while(tbl < tblterm) {
			if (!memcmp(sffh->sfh.hdr.index, tbl->index, sizeof(sffh->sfh.hdr.index))) {
				break;
			}
			tbl++;
		}
		if (tbl < tblterm) {
			switch(tbl->type) {
				case STATFLAG_BIN:
					ret |= flagload_common(&sffh->sfh, tbl);
					break;

				case STATFLAG_TERM:
					done = TRUE;
					break;

				case STATFLAG_COM:
					ret |= flagload_com(&sffh->sfh, tbl);
					break;

				case STATFLAG_DMA:
					ret |= flagload_dma(&sffh->sfh, tbl);
					break;

				case STATFLAG_EGC:
					ret |= flagload_egc(&sffh->sfh, tbl);
					break;

				case STATFLAG_EPSON:
					ret |= flagload_epson(&sffh->sfh, tbl);
					break;

				case STATFLAG_EVT:
					ret |= flagload_evt(&sffh->sfh, tbl);
					break;

				case STATFLAG_EXT:
					ret |= flagload_ext(&sffh->sfh, tbl);
					break;

				case STATFLAG_FDD:
					ret |= flagload_fdd(&sffh->sfh, tbl);
					break;

#if !defined(DISABLE_SOUND)
				case STATFLAG_FM:
					ret |= flagload_fm(&sffh->sfh, tbl);
					break;
#endif

				case STATFLAG_GIJ:
					ret |= flagload_gij(&sffh->sfh, tbl);
					break;

#if defined(SUPPORT_HOSTDRV)
				case STATFLAG_HDRV:
					ret |= hostdrv_sfload(&sffh->sfh, tbl);
					break;
#endif

				case STATFLAG_MEM:
					ret |= flagload_mem(&sffh->sfh, tbl);
					break;

				case STATFLAG_SXSI:
					ret |= flagload_sxsi(&sffh->sfh, tbl);
					break;

				default:
					ret |= STATFLAG_WARNING;
					break;
			}
		}
		else {
			ret |= STATFLAG_WARNING;
		}
	}
	statflag_close(sffh);

	// I/O作り直し
	MEMM_ARCH((pccore.model & PCMODEL_EPSON)?1:0);
	iocore_build();
	iocore_bind();
	cbuscore_bind();
	fmboard_bind();

	gdcs.textdisp |= GDCSCRN_EXT;
	gdcs.textdisp |= GDCSCRN_ALLDRAW2;
	gdcs.grphdisp |= GDCSCRN_EXT;
	gdcs.grphdisp |= GDCSCRN_ALLDRAW2;
	gdcs.palchange = GDCSCRN_REDRAW;
	tramflag.renewal = 1;
	cgwindow.writable |= 0x80;
#if defined(CPUSTRUC_FONTPTR)
	FONTPTR_LOW = fontrom + cgwindow.low;
	FONTPTR_HIGH = fontrom + cgwindow.high;
#endif
	MEMM_VRAM(vramop.operate);
	fddmtr_reset();
	soundmng_play();

	return(ret);
}
Esempio n. 3
0
static void np2cmd(HWND hWnd, UINT16 cmd) {

	UINT	update;

	update = 0;
	switch(cmd) {
		case IDM_RESET:
			pccore_cfgupdate();
			pccore_reset();
			break;

		case IDM_CONFIG:
			winuienter();
			DialogBox(hInst, MAKEINTRESOURCE(IDD_CONFIG),
											hWnd, (DLGPROC)CfgDialogProc);
			winuileave();
			break;

		case IDM_NEWDISK:
			winuienter();
			dialog_newdisk(hWnd);
			winuileave();
			break;

		case IDM_CHANGEFONT:
			winuienter();
			dialog_font(hWnd);
			winuileave();
			break;

		case IDM_EXIT:
			SendMessage(hWnd, WM_CLOSE, 0, 0L);
			break;

		case IDM_FDD1OPEN:
			winuienter();
			dialog_changefdd(hWnd, 0);
			winuileave();
			break;

		case IDM_FDD1EJECT:
			diskdrv_setfdd(0, NULL, 0);
			break;

		case IDM_FDD2OPEN:
			winuienter();
			dialog_changefdd(hWnd, 1);
			winuileave();
			break;

		case IDM_FDD2EJECT:
			diskdrv_setfdd(1, NULL, 0);
			break;

		case IDM_SASI1OPEN:
			winuienter();
			dialog_changehdd(hWnd, 0);
			winuileave();
			break;

		case IDM_SASI1EJECT:
			diskdrv_sethdd(0, NULL);
			break;

		case IDM_SASI2OPEN:
			winuienter();
			dialog_changehdd(hWnd, 1);
			winuileave();
			break;

		case IDM_SASI2EJECT:
			diskdrv_sethdd(1, NULL);
			break;

		case IDM_WINDOW:
			changescreen(scrnmode & (~SCRNMODE_FULLSCREEN));
			break;

		case IDM_FULLSCREEN:
			changescreen(scrnmode | SCRNMODE_FULLSCREEN);
			break;

		case IDM_ROLNORMAL:
			xmenu_setroltate(0);
			changescreen(scrnmode & (~SCRNMODE_ROTATEMASK));
			break;

		case IDM_ROLLEFT:
			xmenu_setroltate(1);
			changescreen((scrnmode & (~SCRNMODE_ROTATEMASK)) |
														SCRNMODE_ROTATELEFT);
			break;

		case IDM_ROLRIGHT:
			xmenu_setroltate(2);
			changescreen((scrnmode & (~SCRNMODE_ROTATEMASK)) |
														SCRNMODE_ROTATERIGHT);
			break;

		case IDM_DISPSYNC:
			xmenu_setdispmode(np2cfg.DISPSYNC ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_RASTER:
			xmenu_setraster(np2cfg.RASTER ^ 1);
			if (np2cfg.RASTER) {
				changescreen(scrnmode | SCRNMODE_HIGHCOLOR);
			}
			else {
				changescreen(scrnmode & (~SCRNMODE_HIGHCOLOR));
			}
			update |= SYS_UPDATECFG;
			break;

		case IDM_NOWAIT:
			xmenu_setwaitflg(np2oscfg.NOWAIT ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_AUTOFPS:
			xmenu_setframe(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_60FPS:
			xmenu_setframe(1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_30FPS:
			xmenu_setframe(2);
			update |= SYS_UPDATECFG;
			break;

		case IDM_20FPS:
			xmenu_setframe(3);
			update |= SYS_UPDATECFG;
			break;

		case IDM_15FPS:
			xmenu_setframe(4);
			update |= SYS_UPDATECFG;
			break;

		case IDM_SCREENOPT:
			winuienter();
			dialog_scropt(hWnd);
			winuileave();
			break;

		case IDM_KEY:
			xmenu_setkey(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_JOY1:
			xmenu_setkey(1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_JOY2:
			xmenu_setkey(2);
			update |= SYS_UPDATECFG;
			break;

		case IDM_XSHIFT:
			xmenu_setxshift(np2cfg.XSHIFT ^ 1);
			keystat_forcerelease(0x70);
			update |= SYS_UPDATECFG;
			break;

		case IDM_XCTRL:
			xmenu_setxshift(np2cfg.XSHIFT ^ 2);
			keystat_forcerelease(0x74);
			update |= SYS_UPDATECFG;
			break;

		case IDM_XGRPH:
			xmenu_setxshift(np2cfg.XSHIFT ^ 4);
			keystat_forcerelease(0x73);
			update |= SYS_UPDATECFG;
			break;

		case IDM_F12MOUSE:
			xmenu_setf12copy(0);
			winkbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12COPY:
			xmenu_setf12copy(1);
			winkbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12STOP:
			xmenu_setf12copy(2);
			winkbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12EQU:
			xmenu_setf12copy(3);
			winkbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12COMMA:
			xmenu_setf12copy(4);
			winkbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_BEEPOFF:
			xmenu_setbeepvol(0);
			beep_setvol(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_BEEPLOW:
			xmenu_setbeepvol(1);
			beep_setvol(1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_BEEPMID:
			xmenu_setbeepvol(2);
			beep_setvol(2);
			update |= SYS_UPDATECFG;
			break;

		case IDM_BEEPHIGH:
			xmenu_setbeepvol(3);
			beep_setvol(3);
			update |= SYS_UPDATECFG;
			break;

		case IDM_NOSOUND:
			xmenu_setsound(0x00);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_14:
			xmenu_setsound(0x01);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_26K:
			xmenu_setsound(0x02);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_86:
			xmenu_setsound(0x04);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_26_86:
			xmenu_setsound(0x06);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_86_CB:
			xmenu_setsound(0x14);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_118:
			xmenu_setsound(0x08);
			update |= SYS_UPDATECFG;
			break;

		case IDM_SPEAKBOARD:
			xmenu_setsound(0x20);
			update |= SYS_UPDATECFG;
			break;

		case IDM_SPARKBOARD:
			xmenu_setsound(0x40);
			update |= SYS_UPDATECFG;
			break;

		case IDM_AMD98:
			xmenu_setsound(0x80);
			update |= SYS_UPDATECFG;
			break;

		case IDM_JASTSOUND:
			xmenu_setjastsound(np2oscfg.jastsnd ^ 1);
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_SEEKSND:
			xmenu_setmotorflg(np2cfg.MOTOR ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM640:
			xmenu_setextmem(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM16:
			xmenu_setextmem(1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM36:
			xmenu_setextmem(3);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM76:
			xmenu_setextmem(7);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM116:
			xmenu_setextmem(11);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM136:
			xmenu_setextmem(13);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MOUSE:
			mousemng_toggle(MOUSEPROC_SYSTEM);
			xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MPUPC98:
			winuienter();
			DialogBox(hInst, MAKEINTRESOURCE(IDD_MPUPC98),
											hWnd, (DLGPROC)MidiDialogProc);
			winuileave();
			break;

		case IDM_MIDIPANIC:									// ver0.29
			rs232c_midipanic();
			mpu98ii_midipanic();
			pc9861k_midipanic();
			break;

		case IDM_SNDOPT:
			winuienter();
			dialog_sndopt(hWnd);
			winuileave();
			break;

		case IDM_BMPSAVE:
			winuienter();
			dialog_writebmp(hWnd);
			winuileave();
			break;
#if defined(SUPPPORT_S98)
		case IDM_S98LOGGING:
			winuienter();
			dialog_s98(hWnd);
			winuileave();
			break;
#endif
#if defined(SUPPORT_WAVEREC)
		case IDM_WAVEREC:
			winuienter();
			dialog_waverec(hWnd);
			winuileave();
			break;
#endif
		case IDM_CALENDAR:
			winuienter();
			DialogBox(hInst, MAKEINTRESOURCE(IDD_CALENDAR),
											hWnd, (DLGPROC)ClndDialogProc);
			winuileave();
			break;

		case IDM_JOYX:
			xmenu_setbtnmode(np2cfg.BTN_MODE ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_RAPID:
			xmenu_setbtnrapid(np2cfg.BTN_RAPID ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MSRAPID:
			xmenu_setmsrapid(np2cfg.MOUSERAPID ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_I286SAVE:
			debugsub_status();
			break;

		case IDM_HELP:
			ShellExecute(hWnd, NULL, file_getcd(np2help),
											NULL, NULL, SW_SHOWNORMAL);
			break;

		case IDM_ABOUT:
			winuienter();
			DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUT),
									hWnd, (DLGPROC)AboutDialogProc);
			winuileave();
			break;
	}
	sysmng_update(update);
}
Esempio n. 4
0
static void sys_cmd(MENUID id) {

    UINT	update;

    update = 0;
    switch(id) {
    case MID_RESET:
        pccore_cfgupdate();
        pccore_reset();
        break;

    case MID_CONFIG:
        menudlg_create(DLGCFG_WIDTH, DLGCFG_HEIGHT,
                       (char *)mstr_cfg, dlgcfg_cmd);
        break;

    case MID_FDD1OPEN:
        filesel_fdd(0);
        break;

    case MID_FDD1EJECT:
        diskdrv_setfdd(0, NULL, 0);
        break;

    case MID_FDD2OPEN:
        filesel_fdd(1);
        break;

    case MID_FDD2EJECT:
        diskdrv_setfdd(1, NULL, 0);
        break;

    case MID_SASI1OPEN:
        filesel_hdd(0x00);
        break;

    case MID_SASI1EJECT:
        diskdrv_sethdd(0x00, NULL);
        break;

    case MID_SASI2OPEN:
        filesel_hdd(0x01);
        break;

    case MID_SASI2EJECT:
        diskdrv_sethdd(0x01, NULL);
        break;
#if defined(SUPPORT_SCSI)
    case MID_SCSI0OPEN:
        filesel_hdd(0x20);
        break;

    case MID_SCSI0EJECT:
        diskdrv_sethdd(0x20, NULL);
        break;

    case MID_SCSI1OPEN:
        filesel_hdd(0x21);
        break;

    case MID_SCSI1EJECT:
        diskdrv_sethdd(0x21, NULL);
        break;

    case MID_SCSI2OPEN:
        filesel_hdd(0x22);
        break;

    case MID_SCSI2EJECT:
        diskdrv_sethdd(0x22, NULL);
        break;

    case MID_SCSI3OPEN:
        filesel_hdd(0x23);
        break;

    case MID_SCSI3EJECT:
        diskdrv_sethdd(0x23, NULL);
        break;
#endif
    case MID_DISPSYNC:
        np2cfg.DISPSYNC ^= 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_RASTER:
        np2cfg.RASTER ^= 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_NOWAIT:
        np2oscfg.NOWAIT ^= 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_AUTOFPS:
        np2oscfg.DRAW_SKIP = 0;
        update |= SYS_UPDATECFG;
        break;

    case MID_60FPS:
        np2oscfg.DRAW_SKIP = 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_30FPS:
        np2oscfg.DRAW_SKIP = 2;
        update |= SYS_UPDATECFG;
        break;

    case MID_20FPS:
        np2oscfg.DRAW_SKIP = 3;
        update |= SYS_UPDATECFG;
        break;

    case MID_15FPS:
        np2oscfg.DRAW_SKIP = 4;
        update |= SYS_UPDATECFG;
        break;

    case MID_SCREENOPT:
        menudlg_create(DLGSCR_WIDTH, DLGSCR_HEIGHT,
                       (char *)mstr_scropt, dlgscr_cmd);
        break;

    case MID_KEY:
        np2cfg.KEY_MODE = 0;
        keystat_resetjoykey();
        update |= SYS_UPDATECFG;
        break;

    case MID_JOY1:
        np2cfg.KEY_MODE = 1;
        keystat_resetjoykey();
        update |= SYS_UPDATECFG;
        break;

    case MID_JOY2:
        np2cfg.KEY_MODE = 2;
        keystat_resetjoykey();
        update |= SYS_UPDATECFG;
        break;

    case MID_MOUSEKEY:
        np2cfg.KEY_MODE = 3;
        keystat_resetjoykey();
        update |= SYS_UPDATECFG;
        break;

    case MID_XSHIFT:
        np2cfg.XSHIFT ^= 1;
        keystat_forcerelease(0x70);
        update |= SYS_UPDATECFG;
        break;

    case MID_XCTRL:
        np2cfg.XSHIFT ^= 2;
        keystat_forcerelease(0x74);
        update |= SYS_UPDATECFG;
        break;

    case MID_XGRPH:
        np2cfg.XSHIFT ^= 4;
        keystat_forcerelease(0x73);
        update |= SYS_UPDATECFG;
        break;

    case MID_F12MOUSE:
        np2oscfg.F12KEY = 0;
        sdlkbd_resetf12();
        update |= SYS_UPDATEOSCFG;
        break;

    case MID_F12COPY:
        np2oscfg.F12KEY = 1;
        sdlkbd_resetf12();
        update |= SYS_UPDATEOSCFG;
        break;

    case MID_F12STOP:
        np2oscfg.F12KEY = 2;
        sdlkbd_resetf12();
        update |= SYS_UPDATEOSCFG;
        break;

    case MID_F12EQU:
        np2oscfg.F12KEY = 3;
        sdlkbd_resetf12();
        update |= SYS_UPDATEOSCFG;
        break;

    case MID_F12COMMA:
        np2oscfg.F12KEY = 4;
        sdlkbd_resetf12();
        update |= SYS_UPDATEOSCFG;
        break;

    case MID_BEEPOFF:
        np2cfg.BEEP_VOL = 0;
        beep_setvol(0);
        update |= SYS_UPDATECFG;
        break;

    case MID_BEEPLOW:
        np2cfg.BEEP_VOL = 1;
        beep_setvol(1);
        update |= SYS_UPDATECFG;
        break;

    case MID_BEEPMID:
        np2cfg.BEEP_VOL = 2;
        beep_setvol(2);
        update |= SYS_UPDATECFG;
        break;

    case MID_BEEPHIGH:
        np2cfg.BEEP_VOL = 3;
        beep_setvol(3);
        update |= SYS_UPDATECFG;
        break;

    case MID_NOSOUND:
        np2cfg.SOUND_SW = 0x00;
        update |= SYS_UPDATECFG;
        break;

    case MID_PC9801_14:
        np2cfg.SOUND_SW = 0x01;
        update |= SYS_UPDATECFG;
        break;

    case MID_PC9801_26K:
        np2cfg.SOUND_SW = 0x02;
        update |= SYS_UPDATECFG;
        break;

    case MID_PC9801_86:
        np2cfg.SOUND_SW = 0x04;
        update |= SYS_UPDATECFG;
        break;

    case MID_PC9801_26_86:
        np2cfg.SOUND_SW = 0x06;
        update |= SYS_UPDATECFG;
        break;

    case MID_PC9801_86_CB:
        np2cfg.SOUND_SW = 0x14;
        update |= SYS_UPDATECFG;
        break;

    case MID_PC9801_118:
        np2cfg.SOUND_SW = 0x08;
        update |= SYS_UPDATECFG;
        break;

    case MID_SPEAKBOARD:
        np2cfg.SOUND_SW = 0x20;
        update |= SYS_UPDATECFG;
        break;

    case MID_SPARKBOARD:
        np2cfg.SOUND_SW = 0x40;
        update |= SYS_UPDATECFG;
        break;

    case MID_AMD98:
        np2cfg.SOUND_SW = 0x80;
        update |= SYS_UPDATECFG;
        break;

    case MID_JASTSND:
        np2oscfg.jastsnd ^= 1;
        update |= SYS_UPDATEOSCFG;
        break;

    case MID_SEEKSND:
        np2cfg.MOTOR ^= 1;
        update |= SYS_UPDATECFG;
        break;
#if 0
    case IDM_SNDOPT:
        winuienter();
        dialog_sndopt(hWnd);
        winuileave();
        break;
#endif
    case MID_MEM640:
        np2cfg.EXTMEM = 0;
        update |= SYS_UPDATECFG;
        break;

    case MID_MEM16:
        np2cfg.EXTMEM = 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_MEM36:
        np2cfg.EXTMEM = 3;
        update |= SYS_UPDATECFG;
        break;

    case MID_MEM76:
        np2cfg.EXTMEM = 7;
        update |= SYS_UPDATECFG;
        break;
#if 0
    case IDM_MOUSE:
        mousemng_toggle(MOUSEPROC_SYSTEM);
        xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1);
        update |= SYS_UPDATECFG;
        break;

    case IDM_SERIAL1:
        winuienter();
        dialog_serial(hWnd);
        winuileave();
        break;

    case IDM_MPUPC98:
        winuienter();
        DialogBox(hInst, MAKEINTRESOURCE(IDD_MPUPC98),
                  hWnd, (DLGPROC)MidiDialogProc);
        winuileave();
        break;
#endif
    case MID_MIDIPANIC:
        rs232c_midipanic();
        mpu98ii_midipanic();
        pc9861k_midipanic();
        break;
#if 0
    case IDM_BMPSAVE:
        winuienter();
        dialog_writebmp(hWnd);
        winuileave();
        break;

    case IDM_S98LOGGING:
        winuienter();
        dialog_s98(hWnd);
        winuileave();
        break;

    case IDM_DISPCLOCK:
        xmenu_setdispclk(np2oscfg.DISPCLK ^ 1);
        update |= SYS_UPDATECFG;
        break;

    case IDM_DISPFRAME:
        xmenu_setdispclk(np2oscfg.DISPCLK ^ 2);
        update |= SYS_UPDATECFG;
        break;

    case IDM_CALENDAR:
        winuienter();
        DialogBox(hInst, MAKEINTRESOURCE(IDD_CALENDAR),
                  hWnd, (DLGPROC)ClndDialogProc);
        winuileave();
        break;

    case IDM_ALTENTER:
        xmenu_setshortcut(np2oscfg.shortcut ^ 1);
        update |= SYS_UPDATECFG;
        break;

    case IDM_ALTF4:
        xmenu_setshortcut(np2oscfg.shortcut ^ 2);
        update |= SYS_UPDATECFG;
        break;
#endif
    case MID_JOYX:
        np2cfg.BTN_MODE ^= 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_RAPID:
        np2cfg.BTN_RAPID ^= 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_MSRAPID:
        np2cfg.MOUSERAPID ^= 1;
        update |= SYS_UPDATECFG;
        break;

    case MID_ABOUT:
        menudlg_create(DLGABOUT_WIDTH, DLGABOUT_HEIGHT,
                       (char *)mstr_about, dlgabout_cmd);
        break;

#if defined(MENU_TASKMINIMIZE)
    case SID_MINIMIZE:
        taskmng_minimize();
        break;
#endif
    case MID_EXIT:
    case SID_CLOSE:
        taskmng_exit();
        break;
    }
    sysmng_update(update);
}
Esempio n. 5
0
static void HandleMenuChoice(long wParam) {

	UINT	update;
	Str255	applname;
#if defined(SUPPORT_STATSAVE)
	UINT	num;
	char	ext[16];
#endif

	update = 0;
	switch(wParam) {
		case IDM_ABOUT:
			AboutDialogProc();
			break;

		case IDM_RESET:
			pccore_cfgupdate();
			pccore_reset();
			break;

		case IDM_CONFIGURE:
			ConfigDialogProc();
			break;

		case IDM_NEWDISK:
			dialog_newdisk();
			break;

		case IDM_FONT:
			dialog_font();
			break;

		case IDM_EXIT:
			np2running = FALSE;
			break;

		case IDM_FDD1OPEN:
			dialog_changefdd(0);
			break;

		case IDM_FDD1EJECT:
			diskdrv_setfdd(0, NULL, 0);
			break;

		case IDM_FDD2OPEN:
			dialog_changefdd(1);
			break;

		case IDM_FDD2EJECT:
			diskdrv_setfdd(1, NULL, 0);
			break;

		case IDM_FDD3OPEN:
			dialog_changefdd(2);
			break;

		case IDM_FDD3EJECT:
			diskdrv_setfdd(2, NULL, 0);
			break;

		case IDM_FDD4OPEN:
			dialog_changefdd(3);
			break;

		case IDM_FDD4EJECT:
			diskdrv_setfdd(3, NULL, 0);
			break;

		case IDM_SASI1OPEN:
			dialog_changehdd(0x00);
			break;

		case IDM_SASI1REMOVE:
			diskdrv_sethdd(0x00, NULL);
			break;

		case IDM_SASI2OPEN:
			dialog_changehdd(0x01);
			break;

		case IDM_SASI2REMOVE:
			diskdrv_sethdd(0x01, NULL);
			break;

		case IDM_SCSI0OPEN:
			dialog_changehdd(0x20);
			break;

		case IDM_SCSI0REMOVE:
			diskdrv_sethdd(0x20, NULL);
			break;

		case IDM_SCSI1OPEN:
			dialog_changehdd(0x21);
			break;

		case IDM_SCSI1REMOVE:
			diskdrv_sethdd(0x21, NULL);
			break;

		case IDM_SCSI2OPEN:
			dialog_changehdd(0x22);
			break;

		case IDM_SCSI2REMOVE:
			diskdrv_sethdd(0x22, NULL);
			break;

		case IDM_SCSI3OPEN:
			dialog_changehdd(0x23);
			break;

		case IDM_SCSI3REMOVE:
			diskdrv_sethdd(0x23, NULL);
			break;

		case IDM_ROLNORMAL:
			menu_setrotate(0);
			changescreen(scrnmode & (~SCRNMODE_ROTATEMASK));
			break;

		case IDM_ROLLEFT:
			menu_setrotate(1);
			changescreen((scrnmode & (~SCRNMODE_ROTATEMASK)) |
														SCRNMODE_ROTATELEFT);
			break;

		case IDM_ROLRIGHT:
			menu_setrotate(2);
			changescreen((scrnmode & (~SCRNMODE_ROTATEMASK)) |
														SCRNMODE_ROTATERIGHT);
			break;

		case IDM_DISPSYNC:
			menu_setdispmode(np2cfg.DISPSYNC ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_RASTER:
			menu_setraster(np2cfg.RASTER ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_NOWAIT:
			menu_setwaitflg(np2oscfg.NOWAIT ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_AUTOFPS:
			menu_setframe(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_60FPS:
			menu_setframe(1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_30FPS:
			menu_setframe(2);
			update |= SYS_UPDATECFG;
			break;

		case IDM_20FPS:
			menu_setframe(3);
			update |= SYS_UPDATECFG;
			break;

		case IDM_15FPS:
			menu_setframe(4);
			update |= SYS_UPDATECFG;
			break;

		case IDM_SCREENOPT:
			dialog_scropt();
			break;

		case IDM_MOUSE:
			mousemng_toggle(MOUSEPROC_SYSTEM);
			menu_setmouse(np2oscfg.MOUSE_SW ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MIDIOPT:
			MPU98DialogProc();
			break;

		case IDM_MIDIPANIC:
			rs232c_midipanic();
			mpu98ii_midipanic();
			pc9861k_midipanic();
			break;

		case IDM_KEY:
			menu_setkey(0);
			keystat_resetjoykey();
			update |= SYS_UPDATECFG;
			break;

		case IDM_JOY1:
			menu_setkey(1);
			keystat_resetjoykey();
			update |= SYS_UPDATECFG;
			break;

		case IDM_JOY2:
			menu_setkey(2);
			keystat_resetjoykey();
			update |= SYS_UPDATECFG;
			break;

		case IDM_MOUSEKEY:
			menu_setkey(3);
			keystat_resetjoykey();
			update |= SYS_UPDATECFG;
			break;

		case IDM_XSHIFT:
			menu_setxshift(np2cfg.XSHIFT ^ 1);
			keystat_forcerelease(0x70);
			update |= SYS_UPDATECFG;
			break;

		case IDM_XCTRL:
			menu_setxshift(np2cfg.XSHIFT ^ 2);
			keystat_forcerelease(0x74);
			update |= SYS_UPDATECFG;
			break;

		case IDM_XGRPH:
			menu_setxshift(np2cfg.XSHIFT ^ 4);
			keystat_forcerelease(0x73);
			update |= SYS_UPDATECFG;
			break;

		case IDM_F11KANA:
			menu_setf11key(0);
			mackbd_resetf11();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F11STOP:
			menu_setf11key(1);
			mackbd_resetf11();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F11NFER:
			menu_setf11key(3);
			mackbd_resetf11();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F11USER:
			menu_setf11key(4);
			mackbd_resetf11();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12MOUSE:
			menu_setf12key(0);
			mackbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12COPY:
			menu_setf12key(1);
			mackbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12XFER:
			menu_setf12key(3);
			mackbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_F12USER:
			menu_setf12key(4);
			mackbd_resetf12();
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_BEEPOFF:
			menu_setbeepvol(0);
			beep_setvol(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_BEEPLOW:
			menu_setbeepvol(1);
			beep_setvol(1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_BEEPMID:
			menu_setbeepvol(2);
			beep_setvol(2);
			update |= SYS_UPDATECFG;
			break;

		case IDM_BEEPHIGH:
			menu_setbeepvol(3);
			beep_setvol(3);
			update |= SYS_UPDATECFG;
			break;

		case IDM_NOSOUND:
			menu_setsound(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_14:
			menu_setsound(0x01);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_26K:
			menu_setsound(0x02);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_86:
			menu_setsound(0x04);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_26_86:
			menu_setsound(0x06);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_86_CB:
			menu_setsound(0x14);
			update |= SYS_UPDATECFG;
			break;

		case IDM_PC9801_118:
			menu_setsound(0x08);
			update |= SYS_UPDATECFG;
			break;

		case IDM_SPEAKBOARD:
			menu_setsound(0x20);
			update |= SYS_UPDATECFG;
			break;

		case IDM_SPARKBOARD:
			menu_setsound(0x40);
			update |= SYS_UPDATECFG;
			break;

		case IDM_AMD98:
			menu_setsound(0x80);
			update |= SYS_UPDATECFG;
			break;

		case IDM_JASTSND:
			menu_setjastsnd(np2oscfg.jastsnd ^ 1);
			update |= SYS_UPDATEOSCFG;
			break;

		case IDM_SEEKSND:
			menu_setmotorflg(np2cfg.MOTOR ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM640:
			menu_setextmem(0);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM16:
			menu_setextmem(1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM36:
			menu_setextmem(3);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM76:
			menu_setextmem(7);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM116:
			menu_setextmem(11);
			update |= SYS_UPDATECFG;
			break;

		case IDM_MEM136:
			menu_setextmem(13);
			update |= SYS_UPDATECFG;
			break;

		case IDM_BMPSAVE:
			dialog_writebmp();
			break;

		case IDM_CALENDAR:
			CalendarDialogProc();
			break;

		case IDM_DISPCLOCK:
			menu_setdispclk(np2oscfg.DISPCLK ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_DISPFLAME:
			menu_setdispclk(np2oscfg.DISPCLK ^ 2);
			update |= SYS_UPDATECFG;
			break;

		case IDM_JOYX:
			menu_setbtnmode(np2cfg.BTN_MODE ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_RAPID:
			menu_setbtnrapid(np2cfg.BTN_RAPID ^ 1);
			update |= SYS_UPDATECFG;
			break;

		case IDM_I286SAVE:
			debugsub_status();
			break;

		default:
			if (HiWord(wParam) == IDM_APPLE) {
				GetMenuItemText(GetMenuHandle(IDM_APPLE), 
											LoWord(wParam), applname);
#if !TARGET_API_MAC_CARBON
				(void)OpenDeskAcc(applname);
#endif
			}
#if defined(SUPPORT_STATSAVE)
			else if (HiWord(wParam) == IDM_STATSAVE) {
				num = LoWord(wParam);
				if ((num >= 1) && (num < (1 + 10))) {
					SPRINTF(ext, np2flagext, num - 1);
					flagsave(ext);
				}
				else if ((num >= 12) && (num < (12 + 10))) {
					SPRINTF(ext, np2flagext, num - 12);
					flagload(ext, TRUE);
				}
			}
#endif
			break;
	}
	sysmng_update(update);
	HiliteMenu(0);
}