예제 #1
0
파일: ctrl.c 프로젝트: azuwis/xreader
extern dword ctrl_waitkey(dword keymask)
{
	dword key;

	while ((key = ctrl_read()) != key) {
		xrKernelDelayThread(50000);
	}
	return key;
}
예제 #2
0
파일: ctrl.c 프로젝트: azuwis/xreader
extern dword ctrl_waitmask(dword keymask)
{
	dword key;

	while (((key = ctrl_read()) & keymask) == 0) {
		xrKernelDelayThread(50000);
	}
	return key;
}
예제 #3
0
파일: ctrl.c 프로젝트: azuwis/xreader
extern dword ctrl_waitany(void)
{
	dword key;

	while ((key = ctrl_read()) == 0) {
		xrKernelDelayThread(50000);
	}
	return key;
}
예제 #4
0
파일: ctrl.c 프로젝트: azuwis/xreader
extern dword ctrl_waitlyric(void)
{
	dword key;

	while ((key = ctrl_read()) == 0) {
		xrKernelDelayThread(50000);
		if (lyric_check_changed(music_get_lyric()))
			break;
	}
	return key;
}
예제 #5
0
파일: ctrl.c 프로젝트: azuwis/xreader
extern dword ctrl_waittime(dword t)
{
	dword key;
	time_t t1 = time(NULL);

	while ((key = ctrl_read()) == 0) {
		xrKernelDelayThread(50000);
		if (time(NULL) - t1 >= t)
			return 0;
	}
	return key;
}
예제 #6
0
static int cache_wait_avail()
{
	dword key;

	while (ccacher.caches_size == 0) {
		key = ctrl_read();

		if (key == PSP_CTRL_CROSS) {
			return -1;
		}

		xrKernelDelayThread(10000);
	}

	return 0;
}
예제 #7
0
static int cache_wait_loaded()
{
	cache_image_t *img = &ccacher.caches[0];
	dword key;

	while (img->status == CACHE_INIT) {
//      dbg_printf(d, "CLIENT: Wait image %u %s load finish", (unsigned) selidx, filename);
		key = ctrl_read();

		if (key == PSP_CTRL_CROSS) {
			return -1;
		}

		xrKernelDelayThread(10000);
	}

	return 0;
}
예제 #8
0
bool SkinDialog::execute() {
	bool returnValue = false;
	while( true ) {
		//*/
		u32 key = ctrl_read();
		if ( key & PSP_CTRL_CROSS ) {
			break;
		}
		else if ( key & PSP_CTRL_CIRCLE ) {
			strcpy(skinName, skinItems[itemCurrent].shortname);
			returnValue = true;
			break;
		}
		else if( (key & PSP_CTRL_UP) || (key & CTRL_BACK) ) {
			if (itemCurrent != 1){
				itemCurrent--;
			}
			else {
				itemCurrent = itemCount - 1;
			}
		}
		else if( (key & PSP_CTRL_DOWN) || (key & CTRL_FORWARD) ){
			if (itemCurrent + 1 < itemCount) {
				itemCurrent++;
			}
			else 
				itemCurrent = 1;
		}
		else if (key & PSP_CTRL_LTRIGGER ) {
			itemCurrent = 1;
		}
		else if (key & PSP_CTRL_RTRIGGER ) {
			itemCurrent = itemCount - 1;
		}
		//*/
		paint();
		sceKernelDelayThread(12500);
	};
	return returnValue;
};
예제 #9
0
파일: gui.c 프로젝트: sseary/procfw-chn
// exit menu when returns 1
static int menu_ctrl(struct Menu *menu)
{
	u32 key;
	char buf[80];
	int NEW_MAX_MENU_NUMBER_PER_PAGE = ((g_messages == g_messages_chs) || (g_messages == g_messages_cht)) ? (MAX_MENU_NUMBER_PER_PAGE-10) : (MAX_MENU_NUMBER_PER_PAGE);///+

	key = ctrl_read();

	if(key & PSP_CTRL_UP) {
		get_sel_index(menu, -1);
	} else if(key & PSP_CTRL_DOWN) {
		get_sel_index(menu, +1);
	} else if(key & PSP_CTRL_RIGHT) {
		menu_change_value(menu, 1);
	} else if(key & PSP_CTRL_LEFT) {
		menu_change_value(menu, -1);
	} else if(key & PSP_CTRL_LTRIGGER) {
		if(menu->cur_sel > NEW_MAX_MENU_NUMBER_PER_PAGE) {///|if(menu->cur_sel > MAX_MENU_NUMBER_PER_PAGE) {
			menu->cur_sel -= NEW_MAX_MENU_NUMBER_PER_PAGE;///|menu->cur_sel -= MAX_MENU_NUMBER_PER_PAGE;
		} else {
			menu->cur_sel = 0;
		}
	} else if(key & PSP_CTRL_RTRIGGER) {
		if(menu->cur_sel + NEW_MAX_MENU_NUMBER_PER_PAGE < menu->submenu_size) {///|if(menu->cur_sel + MAX_MENU_NUMBER_PER_PAGE < menu->submenu_size) {
			menu->cur_sel += NEW_MAX_MENU_NUMBER_PER_PAGE;///|menu->cur_sel += MAX_MENU_NUMBER_PER_PAGE;
		} else {
			menu->cur_sel = menu->submenu_size;
		}
	} else if(key & g_ctrl_OK) {
		struct MenuEntry *entry;
		int (*enter_callback)(struct MenuEntry *);

		if(menu->cur_sel == 0) {
			goto exit;
		}

		entry = &menu->submenu[menu->cur_sel-1];
		enter_callback = entry->enter_callback;

		if(entry->type == TYPE_SUBMENU) {
			sprintf(buf, "> %s...", g_messages[ENTERING]);
			set_bottom_info(buf, 0xFF);
			frame_end();
			sceKernelDelayThread(ENTER_DELAY);
			set_bottom_info("", 0);
		}
		
		if(enter_callback != NULL) {
			(*enter_callback)(entry);
		}
	} else if(key & g_ctrl_CANCEL) {
exit:
		sprintf(buf, "> %s...", g_messages[EXITING]);
		set_bottom_info(buf, 0xFF);
		frame_end();
		sceKernelDelayThread(EXIT_DELAY);
		set_bottom_info("", 0);

		return 1;
	} else if(key & PSP_CTRL_SELECT) {
		recovery_exit();
		
		return 1;
	}

	return 0;
}