示例#1
0
文件: filesel.c 项目: utamaro/np2.js
void filesel_hdd(REG8 drv) {

	UINT		num;
	OEMCHAR		*p;
const FSELPRM	*prm;
	OEMCHAR		path[MAX_PATH];

	num = drv & 0x0f;
	p = NULL;
	prm = NULL;
	if (!(drv & 0x20)) {		// SASI/IDE
		if (num < 2) {
			p = np2cfg.sasihdd[num];
			prm = &sasiprm;
		}
	}
#if defined(SUPPORT_SCSI)
	else {						// SCSI
		if (num < 4) {
			p = np2cfg.scsihdd[num];
			prm = &scsiprm;
		}
	}
#endif
#ifdef EMSCRIPTEN
	if (prm){
	  selectfile(prm, path, NELEMENTS(path), p,1,drv);
	}
#else
	if ((prm) && (selectfile(prm, path, NELEMENTS(path), p))) {
		diskdrv_sethdd(drv, path);
	}
#endif
}
示例#2
0
文件: np2.cpp 项目: FREEWING-JP/np2pi
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);
}
示例#3
0
文件: sysmenu.c 项目: perabuss/np2wii
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);
}
示例#4
0
文件: np2.cpp 项目: perabuss/np2wii
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);
}
示例#5
0
文件: menu.c 项目: perabuss/np2wii
void wiimenu_loadgame()
{
	gamelistentry list[20];
	gamelistentry gamesunk[20];
	gamelistentry gamesfdd[20];
	gamelistentry gameshdd[20];
	int loaded = 0;
	int* listcnt = wiimenu_buildgamelist("sd:/PC98/ROMS/", list, 20, gamesunk, gamesfdd, gameshdd);
	printf("\x1b[J\n\n");
	if(listcnt == NULL) {
		printf("  Could not get file list. Exiting...\n");
		sleep(5);
		wii_shutdown(0);
		return;
	}
	printf("\x1b[J\n\n");
	printf("  Found:\n  %d Unknown Files\n  %d FDD Images\n  %d HDD Images\n", listcnt[BASETYPE_UNKNOWN], listcnt[BASETYPE_FDD], listcnt[BASETYPE_HDD]);
	BorderOverlay();
	sleep(1);
	while(!loaded) {
		if(time_to_leave)
			break;
		wiimenu_choosefromlist(gamesunk, gamesfdd, gameshdd, listcnt, &selected);
		printf("\x1b[J\n\n");
		if(selected.hdd0 != NULL) {
			printf("  Loading %s into HDD0.\n", selected.hdd0);
			diskdrv_sethdd(0x00, selected.hdd0);
			BorderOverlay();
			sleep(1);
			loaded = 1;
		}
		if(selected.hdd1 != NULL) {
			printf("  Loading %s into HDD1.\n", selected.hdd1);
			diskdrv_sethdd(0x01, selected.hdd1);
			BorderOverlay();
			sleep(1);
			loaded = 1;
		}
		if(selected.fdd0 != NULL) {
			printf("  Loading %s into FDD0.\n", selected.fdd0);
			diskdrv_setfdd(0x00, selected.fdd0, 0);
			BorderOverlay();
			sleep(1);
			loaded = 1;
		}
		if(selected.fdd0 != NULL) {
			printf("  Loading %s into FDD1.\n", selected.fdd1);
			diskdrv_setfdd(0x01, selected.fdd1, 0);
			BorderOverlay();
			sleep(1);
			loaded = 1;
		}
		if(!loaded) {
			printf("  ERROR: No disks loaded! Please choose a disk!\n");
			BorderOverlay();
			sleep(1);
		}
	}
	started = 1;
	sleep(1);
	diskdrv_hddbind();
	free(listcnt);
}