Exemplo n.º 1
0
static void dlginit(void)
{
	menudlg_setval(DID_JOYPAD1, np2oscfg.JOYPAD1 & 1);

	menudlg_setval(DID_PAD1_1A, np2oscfg.JOY1BTN[0] & 1);
	menudlg_setval(DID_PAD1_1B, np2oscfg.JOY1BTN[1] & 1);
	menudlg_setval(DID_PAD1_1C, np2oscfg.JOY1BTN[2] & 1);
	menudlg_setval(DID_PAD1_1D, np2oscfg.JOY1BTN[3] & 1);

	menudlg_setval(DID_PAD1_2A, (np2oscfg.JOY1BTN[0] & 2) >> 1);
	menudlg_setval(DID_PAD1_2B, (np2oscfg.JOY1BTN[1] & 2) >> 1);
	menudlg_setval(DID_PAD1_2C, (np2oscfg.JOY1BTN[2] & 2) >> 1);
	menudlg_setval(DID_PAD1_2D, (np2oscfg.JOY1BTN[3] & 2) >> 1);
};
Exemplo n.º 2
0
static void dlginit(void) {

	MENUID	id;

	menudlg_appends(res_cfg, NELEMENTS(res_cfg));
	if (np2cfg.baseclock < ((PCBASECLOCK25 + PCBASECLOCK20) / 2)) {
		id = DID_CLOCK1;
	}
	else {
		id = DID_CLOCK2;
	}
	menudlg_setval(id, 1);
	menudlg_setval(DID_MULTIPLE, np2cfg.multiple);

	if (!milstr_cmp(np2cfg.model, str_VM)) {
		id = DID_MODELVM;
	}
	else if (!milstr_cmp(np2cfg.model, str_EPSON)) {
		id = DID_MODELEPSON;
	}
	else {
		id = DID_MODELVX;
	}
	menudlg_setval(id, 1);

	if (np2cfg.samplingrate < ((11025 + 22050) / 2)) {
		id = DID_RATE11;
	}
	else if (np2cfg.samplingrate < ((22050 + 44100) / 2)) {
		id = DID_RATE22;
	}
	else {
		id = DID_RATE44;
	}
	menudlg_setval(id, 1);
	menudlg_setval(DID_BUFFER, np2cfg.delayms);

	menudlg_setval(DID_RESUME, np2oscfg.resume);

	setmulstr();
	setclockstr();
	setbufstr();

#if defined(DISABLE_SOUND)
	menudlg_setenable(DID_RATE11, FALSE);
	menudlg_setenable(DID_RATE22, FALSE);
	menudlg_setenable(DID_RATE44, FALSE);
	menudlg_setenable(DID_BUFFER, FALSE);
#endif
}
Exemplo n.º 3
0
static void dlginit(void) {

	UINT		i;
const TABLISTS	*tl;

	menudlg_appends(res_scr0, NELEMENTS(res_scr0));
	tl = tablist;
	for (i=0; i<NELEMENTS(tablist); i++, tl++) {
		menudlg_setpage((MENUID)(i + 1));
		menudlg_itemappend(DID_TAB, (OEMCHAR *)tl->tab);
		menudlg_appends(tl->prm, tl->count);
	}

	menudlg_setval(DID_LCD, np2cfg.LCD_MODE & 1);
	menudlg_setenable(DID_LCDX, np2cfg.LCD_MODE & 1);
	menudlg_setval(DID_LCDX, np2cfg.LCD_MODE & 2);
	menudlg_setval(DID_SKIPLINE, np2cfg.skipline);
	menudlg_setval(DID_SKIPLIGHT, np2cfg.skiplight);
	setintstr(DID_LIGHTSTR, np2cfg.skiplight);

	if (!np2cfg.uPD72020) {
		menudlg_setval(DID_GDC7220, TRUE);
	}
	else {
		menudlg_setval(DID_GDC72020, TRUE);
	}
	menudlg_setval(gdcchip[np2cfg.grcg & 3], TRUE);
	menudlg_setval(DID_PC980124, np2cfg.color16);

	menudlg_setval(DID_TRAMWAIT, np2cfg.wait[0]);
	setintstr(DID_TRAMSTR, np2cfg.wait[0]);
	menudlg_setval(DID_VRAMWAIT, np2cfg.wait[2]);
	setintstr(DID_VRAMSTR, np2cfg.wait[2]);
	menudlg_setval(DID_GRCGWAIT, np2cfg.wait[4]);
	setintstr(DID_GRCGSTR, np2cfg.wait[4]);
	menudlg_setval(DID_REALPAL, np2cfg.realpal);
	setintstr(DID_REALPALSTR, np2cfg.realpal - 32);

	menudlg_setval(DID_TAB, 0);
	setpage(0);
}
Exemplo n.º 4
0
int snd_menu(Sound *menu, int num_items)
{
	float x,y;
	float base_width = MAX_MENU_SIZE;
	float base_height = ((menu[num_items-1].y + ui_font_height()) - menu[0].y);

	int menu_pos;
	char work[32];

	int max_menu = 0;

	base_height += ui_font_height() * 2;
	for (int i = 0; i < num_items; ++i) {
    
		switch (menu[i].type) {
		case DLGTYPE_RADIO:
		case DLGTYPE_CHECK:
		case DLGTYPE_SLIDER:
			++max_menu;
			break;
		}
	}

	int result = -1;
	int id = 0;
	int sel = 0;
#if 0  
	int max_val  = 0;
	int min_val = 0;
	int val_index = 0;
#endif  
	float offx = ui_offx() + (ui_width() - base_width) / 2;
	float offy = ui_offy() + (ui_height() - base_height) / 2;

	int fade = 128;
  
	for (;;) {
		uisys_task();
      
		if (ui_keyrepeat(JOY_UP)) {

			switch (result) {
			case DID_PAD1_1A:
			case DID_PAD1_1B:
			case DID_PAD1_1C:
			case DID_PAD1_1D:
			case DID_PAD1_2A:
			case DID_PAD1_2B:
			case DID_PAD1_2C:
			case DID_PAD1_2D:
			case DID_PAD1_RA:
			case DID_PAD1_RB:
			case DID_PAD1_RC:
			case DID_PAD1_RD:
				break;
	
			default:
				if (--sel < 0)
					sel = max_menu - 1;
			}
      
		} else if (ui_keyrepeat(JOY_DOWN)) {
      
			switch (result) {
				
			case DID_PAD1_1A:
			case DID_PAD1_1B:
			case DID_PAD1_1C:
			case DID_PAD1_1D:
			case DID_PAD1_2A:
			case DID_PAD1_2B:
			case DID_PAD1_2C:
			case DID_PAD1_2D:
			case DID_PAD1_RA:
			case DID_PAD1_RB:
			case DID_PAD1_RC:
			case DID_PAD1_RD:
				break;
	
			default:
				if (++sel > (max_menu - 1))
					sel = 0;
			}
		}
#if 0			
		else if (ui_keyrepeat(JOY_RIGHT) || ui_keyrepeat(JOY_RTRIGGER)) {
      
			switch (result) {
			case DID_PAD1_1A:
			case DID_PAD1_1B:
			case DID_PAD1_1C:
			case DID_PAD1_1D:
			case DID_PAD1_2A:
			case DID_PAD1_2B:
			case DID_PAD1_2C:
			case DID_PAD1_2D:
			case DID_PAD1_RA:
			case DID_PAD1_RB:
			case DID_PAD1_RC:
			case DID_PAD1_RD:
				if (++val_index > max_val)
					val_index = max_val;
				break;
	
			default:
				if (++menu_index > 1) {
					menu_index = 1;
				} else {
					return 0;
				}
			}
		} else if (ui_keyrepeat(JOY_LEFT) || ui_keyrepeat(JOY_LTRIGGER)) {
      
			switch (result) {
			case DID_PAD1_1A:
			case DID_PAD1_1B:
			case DID_PAD1_1C:
			case DID_PAD1_1D:
			case DID_PAD1_2A:
			case DID_PAD1_2B:
			case DID_PAD1_2C:
			case DID_PAD1_2D:
			case DID_PAD1_RA:
			case DID_PAD1_RB:
			case DID_PAD1_RC:
			case DID_PAD1_RD:
				if (--val_index < min_val)
					val_index = min_val;
				break;
	
			default:
				if (--menu_index < 0) {
					menu_index = 0;
				} else {
					return 0;
				}
			}
		}
#endif
    
		if (ui_keypressed(JOY_A)) {

			switch (id) {

			case DID_JOYPAD1:
				menudlg_setval(id, !menudlg_getval(id));
				break;
				
			case DID_PAD1_1A:
			case DID_PAD1_1B:
			case DID_PAD1_1C:
			case DID_PAD1_1D:
			case DID_PAD1_2A:
			case DID_PAD1_2B:
			case DID_PAD1_2C:
			case DID_PAD1_2D:
			case DID_PAD1_RA:
			case DID_PAD1_RB:
			case DID_PAD1_RC:
			case DID_PAD1_RD:
				dlg_btn(id);
				break;

			}
		}
    
		if (ui_keypressed(JOY_B)) {

			switch (result) {
			case DID_PAD1_1A:
			case DID_PAD1_1B:
			case DID_PAD1_1C:
			case DID_PAD1_1D:
			case DID_PAD1_2A:
			case DID_PAD1_2B:
			case DID_PAD1_2C:
			case DID_PAD1_2D:
			case DID_PAD1_RA:
			case DID_PAD1_RB:
			case DID_PAD1_RC:
			case DID_PAD1_RD:
				result = -1;
				break;

			default:
				if (result < 0)
					return -1;
			}
		}

		if ((fade += 255/60) > 255) fade = 128;
      
		tx_resetfont();

		scrnmng_update();
		draw_transquad(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, UI_TR, UI_TR, UI_TR, UI_TR);
		draw_transquad(offx, offy, offx + base_width, offy + base_height, UI_BS, UI_BS, UI_BS, UI_BS);
      
		OEMSPRINTF(work, "%s ", mstr_snd);
		x = offx + (base_width - strlen(work) * ui_font_width()) / 2;
		y = offy;
		ui_font_draw(x, y, 255, 255, 255, work);

		y += ui_font_height();
		x = offx;

		draw_transquad(offx, y, offx + base_width, y + 1, MAKECOL32(128, 128, 128, 255),
					   MAKECOL32(128, 128, 128, 255), MAKECOL32(128, 128, 128, 255), MAKECOL32(128, 128, 128, 255));

		y += 6;

		menu_pos = 0;
		for (int i = 0; i < num_items; ++i) {
			
			int r = menu[i].r;
			int g = menu[i].g;
			int b = menu[i].b;
      
			switch (menu[i].type) {
	  
			case DLGTYPE_RADIO:
			case DLGTYPE_CHECK:
				if (menu_pos == sel) {

					draw_transquad(offx, y + menu[i].y, offx + base_width, y + menu[i].y + ui_font_height() + 5, MAKECOL32(255, 0, 0, fade), MAKECOL32(255, 0, 0, fade), MAKECOL32(255, 0, 0, fade), MAKECOL32(255, 0, 0, fade));

					id = menu[i].id;
				}


				switch (menu[i].id) {
	    
				default:
					if (menudlg_getval(menu[i].id))
						draw_pointer(x + menu[i].x - ui_font_width(), y + menu[i].y, 1);
				}
				ui_font_draw(x + menu[i].x, y + menu[i].y, r, g, b, (const char *)menu[i].arg);
				++menu_pos;
				break;
			}
		}
    
		for (int i = 0; i < num_items; ++i) {
      
			switch (menu[i].type) {
	
			case DLGTYPE_FRAME:
			case DLGTYPE_LTEXT:
			case DLGTYPE_RTEXT:
				ui_font_draw(x + menu[i].x, y + menu[i].y, menu[i].r, menu[i].g, menu[i].b, (const char *)menu[i].arg);
				break;
			}
		}

		x = ui_offx();
		y = ui_height() - ui_font_height();
    
		switch (result) {
		default:
			ui_font_draw(x, y, 255, 255, 255, "A:Select B:Back");
		}
		
		ta_commit_frame();
	}
}
Exemplo n.º 5
0
static void dlg_btn(int id)
{
	switch (id) {
    case DID_PAD1_1A:
	case DID_PAD1_2A:
	case DID_PAD1_RA:
		menudlg_setval(DID_PAD1_1A, 0);
		menudlg_setval(DID_PAD1_2A, 0);
		menudlg_setval(DID_PAD1_RA, 0);
		menudlg_setval(id, 1);
		break;
		
	case DID_PAD1_1B:
	case DID_PAD1_2B:
	case DID_PAD1_RB:
		menudlg_setval(DID_PAD1_1B, 0);
		menudlg_setval(DID_PAD1_2B, 0);
		menudlg_setval(DID_PAD1_RB, 0);
		menudlg_setval(id, 1);
		break;
		
	case DID_PAD1_1C:
	case DID_PAD1_2C:
	case DID_PAD1_RC:
		menudlg_setval(DID_PAD1_1C, 0);
		menudlg_setval(DID_PAD1_2C, 0);
		menudlg_setval(DID_PAD1_RC, 0);
		menudlg_setval(id, 1);
		break;
		
	case DID_PAD1_1D:
	case DID_PAD1_2D:
	case DID_PAD1_RD:
		menudlg_setval(DID_PAD1_1D, 0);
		menudlg_setval(DID_PAD1_2D, 0);
		menudlg_setval(DID_PAD1_RD, 0);
		menudlg_setval(id, 1);
		break;
	}
}