Beispiel #1
0
int dlgscr_cmd(int msg, MENUID id, long param) {

	switch(msg) {
		case DLGMSG_CREATE:
			dlginit();
			break;

		case DLGMSG_COMMAND:
			switch(id) {
				case DID_OK:
					dlgupdate();
					menubase_close();
					break;

				case DID_CANCEL:
					menubase_close();
					break;

				case DID_TAB:
					setpage(menudlg_getval(DID_TAB));
					break;

				case DID_LCD:
					menudlg_setenable(DID_LCDX, menudlg_getval(DID_LCD));
					break;

				case DID_SKIPLIGHT:
					setintstr(DID_LIGHTSTR, menudlg_getval(DID_SKIPLIGHT));
					break;

				case DID_TRAMWAIT:
					setintstr(DID_TRAMSTR, menudlg_getval(DID_TRAMWAIT));
					break;

				case DID_VRAMWAIT:
					setintstr(DID_VRAMSTR, menudlg_getval(DID_VRAMWAIT));
					break;

				case DID_GRCGWAIT:
					setintstr(DID_GRCGSTR, menudlg_getval(DID_GRCGWAIT));
					break;

				case DID_REALPAL:
					setintstr(DID_REALPALSTR,
											menudlg_getval(DID_REALPAL) - 32);
					break;
			}
			break;

		case DLGMSG_CLOSE:
			menubase_close();
			break;
	}
	(void)param;
	return(0);
}
Beispiel #2
0
static int dlgcmd(int msg, MENUID id, long param) {

	switch(msg) {
		case DLGMSG_CREATE:
			dlginit();
			break;

		case DLGMSG_COMMAND:
			switch(id) {
				case DID_OK:
					if (dlgupdate()) {
						menubase_close();
					}
					break;

				case DID_CANCEL:
					menubase_close();
					break;

				case DID_PARENT:
					file_cutname(filesel.path);
					file_cutseparator(filesel.path);
					dlgsetlist();
					menudlg_settext(DID_FILE, NULL);
					break;

				case DID_FLIST:
					if (param) {
						return(dlgcmd(DLGMSG_COMMAND, DID_OK, 0));
					}
					else {
						dlgflist();
					}
					break;
			}
			break;

		case DLGMSG_CLOSE:
			menubase_close();
			break;

		case DLGMSG_DESTROY:
			listarray_destroy(filesel.flist);
			filesel.flist = NULL;
			break;
	}
	(void)param;
	return(0);
}
Beispiel #3
0
static void focusenter(MENUSYS *sys, int depth, BOOL exec) {

	MENUHDL	menu;
	MSYSWND	wnd;

	wnd = sys->wnd + depth;
	menu = getitem(sys, depth, wnd->focus);
	if ((menu) && (!(menu->flag & MENU_GRAY)) &&
		(menu->child != NULL)) {
		if (depth == 0) {
			wndclose(sys, 1);
			itemdraw(sys, 0, wnd->focus, 1);
			sys->opened = 1;
		}
		childopn(sys, depth, wnd->focus);
	}
	else if (exec) {
		if ((menu) && (menu->id)) {
			menubase_close();
			sys->cmd(menu->id);
		}
	}
	else {
		focusmove(sys, 0, 1);
	}
}
Beispiel #4
0
BRESULT menusys_open(int x, int y) {

	MENUSYS	*sys;

	sys = &menusys;

	if (menubase_open(1) != SUCCESS) {
		goto msopn_err;
	}
	sys->opened = 0;
	sys->lastdepth = -1;
	sys->lastpos = -1;
	if (wndopenbase(sys) != SUCCESS) {
		goto msopn_err;
	}
	sys->popupx = x;
	sys->popupy = y;
	sys->opened = openpopup(sys);
	menubase_draw(draw, sys);
	return(SUCCESS);

msopn_err:
	menubase_close();
	return(FAILURE);
}
Beispiel #5
0
BRESULT menubase_open(int num) {

	MENUBASE	*mb;
	SCRNMENU	smenu;
	VRAMHDL		hdl;

	mb = &menubase;
	menubase_close();

	if (scrnmng_entermenu(&smenu) != SUCCESS) {
		goto mbopn_err;
	}
	mb->width = smenu.width;
	mb->height = smenu.height;
	mb->bpp = smenu.bpp;
	hdl = vram_create(mb->width, mb->height, TRUE, smenu.bpp);
	menuvram = hdl;
	if (hdl == NULL) {
		goto mbopn_err;
	}
	unionrect_rst(&mb->rect);
	mb->num = num;
	return(SUCCESS);

mbopn_err:
	return(FAILURE);
}
Beispiel #6
0
int dlgcfg_cmd(int msg, MENUID id, long param) {

	switch(msg) {
		case DLGMSG_CREATE:
			dlginit();
			break;

		case DLGMSG_COMMAND:
			switch(id) {
				case DID_OK:
					dlgupdate();
					menubase_close();
					break;

				case DID_CANCEL:
					menubase_close();
					break;

				case DID_CLOCK1:
				case DID_CLOCK2:
					setclockstr();
					break;

				case DID_MULTIPLE:
					setmulstr();
					setclockstr();
					break;

				case DID_BUFFER:
					setbufstr();
					break;
			}
			break;

		case DLGMSG_CLOSE:
			menubase_close();
			break;
	}
	(void)param;
	return(0);
}
Beispiel #7
0
void moviemng_play(const char *fname, SCRN_T *scrn) {

    DAMEDEC	prm;
    char	path[MAX_PATH];
    char	*p;
    int		r;

    menubase_close();
    inputmng_resetmouse(0);

    milstr_ncpy(path, gamecore.suf.scriptpath, sizeof(path));
    milstr_ncat(path, fname, sizeof(path));
    cutExtName(path);
    milstr_ncat(path, ".MVD", sizeof(path));
    p = getFileName(path);
    while(*p) {
        if ((((p[0] ^ 0x20) - 0xa1) & 0xff) < 0x3c) {
            if (p[1] != '\0') {
                p++;
            }
        }
        else if (((p[0] - 0x41) & 0xdf) < 26) {
            p[0] &= 0xdf;
        }
        p++;
    }
    prm.movie = path;
    prm.decproc = DAMEDEC_NOR;
    prm.draw = mvdraw;
    prm.task = mvtask;
    prm.sndplay = mvsndplay;
    prm.sndstop = mvsndstop;
    movieplaying = TRUE;
    r = damedec_play(&prm);
    if (r < 0) {
        TRACEOUT(("damelib error: %d [%s]", r, path));
    }
    movieplaying = 0;

    (void)scrn;
}
Beispiel #8
0
void sysmenu_destroy(void) {

	menubase_close();
	menubase_destroy();
	menusys_destroy();
}
Beispiel #9
0
void menusys_moving(int x, int y, int btn) {

	MENUSYS	*sys;
	MENUPOS	cur;
	int		topwnd;

	sys = &menusys;
	getposinfo(sys, &cur, x, y);

	// メニューを閉じる〜
	if (cur.depth < 0) {
		if (btn == 2) {
			menubase_close();
			return;
		}
	}
	topwnd = sys->depth - 1;
	if (cur.menu != NULL) {
		if (cur.wnd->focus != cur.pos) {
			if (sys->opened) {
				if (cur.depth != topwnd) {
					wndclose(sys, cur.depth + 1);
				}
				if ((!(cur.menu->flag & MENU_GRAY)) &&
					(cur.menu->child != NULL)) {
					childopn(sys, cur.depth, cur.pos);
				}
			}
			itemdraw(sys, cur.depth, cur.wnd->focus, 0);
			itemdraw(sys, cur.depth, cur.pos, 2 - sys->opened);
			cur.wnd->focus = cur.pos;
		}
		if (!(cur.menu->flag & MENU_GRAY)) {
			if (btn == 1) {
				if ((!sys->opened) && (cur.depth == 0) &&
					(cur.menu->child != NULL)) {
					wndclose(sys, 1);
					itemdraw(sys, 0, cur.pos, 1);
					childopn(sys, 0, cur.pos);
					sys->opened = 1;
				}
			}
			else if (btn == 2) {
				if ((cur.menu->id) && (!(cur.menu->flag & MENU_NOSEND))) {
					menubase_close();
					sys->cmd(cur.menu->id);
					return;
				}
			}
		}
	}
	else {
		if ((btn == 1) && (cur.depth == 0)) {
			wndclose(sys, 1);
			itemdraw(sys, 0, cur.wnd->focus, 0);
			sys->opened = openpopup(sys);
		}
		else if (cur.depth != topwnd) {
			cur.depth = topwnd;
			cur.pos = -1;
			cur.wnd = sys->wnd + cur.depth;
			if (cur.wnd->focus != cur.pos) {
				itemdraw(sys, cur.depth, cur.wnd->focus, 0);
				cur.wnd->focus = cur.pos;
			}
		}
	}
	menubase_draw(draw, sys);
}
Beispiel #10
0
void taskmng_rol(void) {

	SDL_Event	e;

	if (SDL_GetTicks() > count + 30 ) {			//0.03秒たった?
		count = SDL_GetTicks() + 10000000;					//カウントリセット
		tap = 0;									//タップ解除
		mousemng.btn |= uPD8255A_LEFTBIT;			//左クリック解除
//		__android_log_print(ANDROID_LOG_INFO, "SDL", "SDL mouseup");
	}


	if ((!task_avail) || (!SDL_PollEvent(&e))) {
		return;
	}
	switch(e.type) {
		case SDL_MOUSEMOTION:

			if (menuvram == NULL) {

				if(e.motion.state == 1) {	//ボタン押されてる
					tap = FALSE;			//動いたのでtapじゃないよ
					mousemng.x = e.motion.xrel;
					mousemng.y = e.motion.yrel;//移動
				}
				else { 						//最初のいらないモーション
				}
			}
			else {
				menubase_moving(e.motion.x, e.motion.y, 0);
			}
			break;

		case SDL_MOUSEBUTTONUP:
//			switch(e.button.button) {
//				case SDL_BUTTON_LEFT:
//					longtap = SDL_GetTicks();//カウントリセット

					if (menuvram == NULL) {
						if (tap) {	//tapかどうかチェック
							mousemng.btn &= ~(uPD8255A_LEFTBIT);//	左クリックを送るよ
							count = SDL_GetTicks();//カウント開始
//							__android_log_print(ANDROID_LOG_INFO, "SDL", "SDL mousedown");
						}

					}
					else {
						menubase_moving(e.button.x, e.button.y, 2);
					}
					break;

//				case SDL_BUTTON_RIGHT:
//					break;
//			}
//			break;

		case SDL_MOUSEBUTTONDOWN:
//			switch(e.button.button) {
//				case SDL_BUTTON_LEFT:

					if (menuvram == NULL) {
						tap = TRUE;	//tapかも知れないよ
//						longtap = SDL_GetTicks();//カウントリセット
					}
					else {
						menubase_moving(e.button.x, e.button.y, 1);
					}
//					break;

//				case SDL_BUTTON_RIGHT:
//					break;
//			}
			break;

		case SDL_KEYDOWN:
			if (e.key.keysym.scancode == SDL_SCANCODE_MENU) {
				if (menuvram == NULL) {
					sysmenu_menuopen(0, 0, 0);
				}
				else {
					menubase_close();
				}
			}
			else if (e.key.keysym.scancode == SDL_SCANCODE_POWER) {
				pccore_cfgupdate();
				pccore_reset();
			}
			else if (e.key.keysym.scancode == SDL_SCANCODE_SELECT) {
				mousemng.btn &= ~(uPD8255A_LEFTBIT);
			}
			else if (e.key.keysym.scancode == SDL_SCANCODE_AC_BACK) {
				mousemng.btn &= ~(uPD8255A_RIGHTBIT);
			}
			else {
				sdlkbd_keydown(e.key.keysym.scancode);
			}
			break;

		case SDL_KEYUP:
			if (e.key.keysym.scancode == SDL_SCANCODE_SELECT) {
				mousemng.btn |= uPD8255A_LEFTBIT;
			}
			else if (e.key.keysym.scancode == SDL_SCANCODE_AC_BACK) {
				mousemng.btn |= uPD8255A_RIGHTBIT;
			}
			else {
				sdlkbd_keyup(e.key.keysym.scancode);
			}
			break;

		case SDL_QUIT:
			task_avail = FALSE;
			break;
	}
}
Beispiel #11
0
void taskmng_rol(void) {

	BOOL		moving;
	int			x;
	int			y;
	SDL_Event	e;

	moving = FALSE;
	x = 0;
	y = 0;
	while((task_avail) && (SDL_PollEvent(&e))) {
		switch(e.type) {
			case SDL_MOUSEMOTION:
				moving = TRUE;
				x = e.motion.x;
				y = e.motion.y;
				break;

			case SDL_MOUSEBUTTONUP:
				if (moving) {
					moving = FALSE;
					if (menuvram == NULL) {
					}
					else {
						menubase_moving(x, y, 0);
					}
				}
				switch(e.button.button) {
					case SDL_BUTTON_LEFT:
						if (menuvram == NULL) {
							sysmenu_menuopen(0, e.button.x, e.button.y);
						}
						else {
							menubase_moving(e.button.x, e.button.y, 2);
						}
						break;

					case SDL_BUTTON_RIGHT:
						break;
				}
				break;

			case SDL_MOUSEBUTTONDOWN:
				if (moving) {
					moving = FALSE;
					if (menuvram == NULL) {
					}
					else {
						menubase_moving(x, y, 0);
					}
				}
				switch(e.button.button) {
					case SDL_BUTTON_LEFT:
						if (menuvram == NULL) {
						}
						else {
							menubase_moving(e.button.x, e.button.y, 1);
						}
						break;

					case SDL_BUTTON_RIGHT:
						break;
				}
				break;

			case SDL_KEYDOWN:
				if (e.key.keysym.sym == SDLK_F11) {
					if (menuvram == NULL) {
						sysmenu_menuopen(0, 0, 0);
					}
					else {
						menubase_close();
					}
				}
				else {
					sdlkbd_keydown(e.key.keysym.sym);
				}
				break;

			case SDL_KEYUP:
				sdlkbd_keyup(e.key.keysym.sym);
				break;

			case SDL_QUIT:
				task_avail = FALSE;
				break;
		}
	}
	if (moving) {
		moving = FALSE;
		if (menuvram == NULL) {
		}
		else {
			menubase_moving(x, y, 0);
		}
	}
}
Beispiel #12
0
void taskmng_rol(void) {

	SDL_Event	e;

	if ((!task_avail) || (!SDL_PollEvent(&e))) {
		return;
	}
	switch(e.type) {
		case SDL_MOUSEMOTION:
			if (menuvram == NULL) {
			}
			else {
				menubase_moving(e.motion.x, e.motion.y, 0);
			}
			break;

		case SDL_MOUSEBUTTONUP:
			switch(e.button.button) {
				case SDL_BUTTON_LEFT:
					if (menuvram == NULL) {
						sysmenu_menuopen(0, e.button.x, e.button.y);
					}
					else {
						menubase_moving(e.button.x, e.button.y, 2);
					}
					break;

				case SDL_BUTTON_RIGHT:
					break;
			}
			break;

		case SDL_MOUSEBUTTONDOWN:
			switch(e.button.button) {
				case SDL_BUTTON_LEFT:
					if (menuvram == NULL) {
					}
					else {
						menubase_moving(e.button.x, e.button.y, 1);
					}
					break;

				case SDL_BUTTON_RIGHT:
					break;
			}
			break;

		case SDL_KEYDOWN:
			if (e.key.keysym.sym == SDLK_F11) {
				if (menuvram == NULL) {
					sysmenu_menuopen(0, 0, 0);
				}
				else {
					menubase_close();
				}
			}
			else {
				sdlkbd_keydown(e.key.keysym.sym);
			}
			break;

		case SDL_KEYUP:
			sdlkbd_keyup(e.key.keysym.sym);
			break;

		case SDL_QUIT:
			task_avail = FALSE;
			break;
	}
}