}\r
\r
// load custom font and selector (stored as 1st symbol in font table)\r
- readpng(menu_font_data, "skin/font.png", READPNG_FONT);\r
+ emu_make_path(buff, "skin/font.png", sizeof(buff));\r
+ readpng(menu_font_data, buff, READPNG_FONT);\r
// default selector symbol is '>'\r
memcpy(menu_font_data, menu_font_data + ((int)'>') * me_mfont_w * me_mfont_h / 2,\r
me_mfont_w * me_mfont_h / 2);\r
- readpng(menu_font_data, "skin/selector.png", READPNG_SELECTOR);\r
+ emu_make_path(buff, "skin/selector.png", sizeof(buff));\r
+ readpng(menu_font_data, buff, READPNG_SELECTOR);\r
\r
// load custom colors\r
- f = fopen("skin/skin.txt", "r");\r
+ emu_make_path(buff, "skin/skin.txt", sizeof(buff));\r
+ f = fopen(buff, "r");\r
if (f != NULL)\r
{\r
lprintf("found skin.txt\n");\r
static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_idx,\r
int sel, int dev_id, int dev_count, int is_bind)\r
{\r
+ char buff[64], buff2[32];\r
const char *dev_name;\r
int x, y, w, i;\r
\r
\r
x = g_screen_width / 2 - w / 2;\r
\r
- if (dev_count > 1) {\r
- text_out16(x, g_screen_height - 4 * me_mfont_h, "Viewing binds for:");\r
- text_out16(x, g_screen_height - 3 * me_mfont_h, dev_name);\r
+ if (!is_bind) {\r
+ snprintf(buff2, sizeof(buff2), "%s", in_get_key_name(-1, -PBTN_MOK));\r
+ snprintf(buff, sizeof(buff), "%s - bind, %s - clear", buff2,\r
+ in_get_key_name(-1, -PBTN_MA2));\r
+ text_out16(x, g_screen_height - 4 * me_mfont_h, buff);\r
}\r
+ else\r
+ text_out16(x, g_screen_height - 4 * me_mfont_h, "Press a button to bind/unbind");\r
\r
- if (is_bind)\r
- text_out16(x, g_screen_height - 2 * me_mfont_h, "Press a button to bind/unbind");\r
- else if (dev_count > 1)\r
+ if (dev_count > 1) {\r
+ text_out16(x, g_screen_height - 3 * me_mfont_h, dev_name);\r
text_out16(x, g_screen_height - 2 * me_mfont_h, "Press left/right for other devs");\r
+ }\r
\r
plat_video_menu_end();\r
}\r
{\r
int i, sel = 0, menu_sel_max = opt_cnt - 1;\r
int dev_id, dev_count, kc, is_down, mkey;\r
- int unbind, bindtype, mask;\r
+ int unbind, bindtype, mask_shift;\r
\r
for (i = 0, dev_id = -1, dev_count = 0; i < IN_MAX_DEVS; i++) {\r
if (in_get_dev_name(i, 1, 0) != NULL) {\r
return;\r
}\r
\r
+ mask_shift = 0;\r
+ if (player_idx == 1)\r
+ mask_shift = 16;\r
+ bindtype = player_idx >= 0 ? IN_BINDTYPE_PLAYER12 : IN_BINDTYPE_EMU;\r
+\r
for (;;)\r
{\r
draw_key_config(opts, opt_cnt, player_idx, sel, dev_id, dev_count, 0);\r
- mkey = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT|PBTN_MBACK|PBTN_MOK, 100);\r
+ mkey = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT|PBTN_MBACK|PBTN_MOK|PBTN_MA2, 100);\r
switch (mkey) {\r
case PBTN_UP: sel--; if (sel < 0) sel = menu_sel_max; continue;\r
case PBTN_DOWN: sel++; if (sel > menu_sel_max) sel = 0; continue;\r
return;\r
while (in_menu_wait_any(30) & PBTN_MOK);\r
break;\r
+ case PBTN_MA2:\r
+ in_unbind_all(dev_id, opts[sel].mask << mask_shift, bindtype);\r
+ continue;\r
default:continue;\r
}\r
\r
for (is_down = 1; is_down; )\r
kc = in_update_keycode(&dev_id, &is_down, -1);\r
\r
- bindtype = player_idx >= 0 ? IN_BINDTYPE_PLAYER12 : IN_BINDTYPE_EMU;\r
- mask = opts[sel].mask;\r
- if (player_idx == 1)\r
- mask <<= 16;\r
-\r
- i = count_bound_keys(dev_id, mask, bindtype);\r
+ i = count_bound_keys(dev_id, opts[sel].mask << mask_shift, bindtype);\r
unbind = (i > 0);\r
\r
/* allow combos if device supports them */\r
in_get_dev_info(dev_id, IN_INFO_DOES_COMBOS))\r
unbind = 0;\r
\r
- in_bind_key(dev_id, kc, bindtype, mask, unbind);\r
+ in_bind_key(dev_id, kc, opts[sel].mask << mask_shift, bindtype, unbind);\r
}\r
}\r
\r
static int menu_loop_keyconfig(menu_id id, int keys)\r
{\r
static int sel = 0;\r
+\r
+ me_enable(e_menu_keyconfig, MA_OPT_SAVECFG_GAME, rom_loaded);\r
me_loop(e_menu_keyconfig, &sel);\r
return 0;\r
}\r