bugfixes, new config system and messed code for it
[picodrive.git] / platform / gizmondo / menu.c
index 09520a9..ce8e92f 100644 (file)
@@ -687,9 +687,7 @@ static int count_bound_keys(int action, int pl_idx)
        return keys;\r
 }\r
 \r
-typedef struct { char *name; int mask; } bind_action_t;\r
-\r
-static void draw_key_config(const bind_action_t *opts, int opt_cnt, int player_idx, int sel)\r
+static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_idx, int sel)\r
 {\r
        int x, y, tl_y = 40, i;\r
 \r
@@ -723,7 +721,7 @@ static void draw_key_config(const bind_action_t *opts, int opt_cnt, int player_i
        menu_draw_end();\r
 }\r
 \r
-static void key_config_loop(const bind_action_t *opts, int opt_cnt, int player_idx)\r
+static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_idx)\r
 {\r
        int sel = 0, menu_sel_max = opt_cnt, prev_select = 0, i;\r
        unsigned long inp = 0;\r
@@ -777,27 +775,10 @@ static void draw_kc_sel(int menu_sel)
 }\r
 \r
 \r
-// PicoPad[] format: MXYZ SACB RLDU\r
-static bind_action_t ctrl_actions[] =\r
-{\r
-       { "UP     ", 0x001 },\r
-       { "DOWN   ", 0x002 },\r
-       { "LEFT   ", 0x004 },\r
-       { "RIGHT  ", 0x008 },\r
-       { "A      ", 0x040 },\r
-       { "B      ", 0x010 },\r
-       { "C      ", 0x020 },\r
-       { "START  ", 0x080 },\r
-       { "MODE   ", 0x800 },\r
-       { "X      ", 0x400 },\r
-       { "Y      ", 0x200 },\r
-       { "Z      ", 0x100 },\r
-};\r
-\r
 // player2_flag, ?, ?, ?, ?, ?, ?, menu\r
 // "NEXT SAVE SLOT", "PREV SAVE SLOT", "SWITCH RENDERER", "SAVE STATE",\r
 // "LOAD STATE", "VOLUME UP", "VOLUME DOWN", "DONE"\r
-static bind_action_t emuctrl_actions[] =\r
+me_bind_action emuctrl_actions[] =\r
 {\r
        { "Load State     ", 1<<28 },\r
        { "Save State     ", 1<<27 },\r
@@ -806,6 +787,7 @@ static bind_action_t emuctrl_actions[] =
        { "Switch Renderer", 1<<26 },\r
        { "Volume Down    ", 1<<30 },\r
        { "Volume Up      ", 1<<29 },\r
+       { NULL,              0     }\r
 };\r
 \r
 static void kc_sel_loop(void)\r
@@ -822,8 +804,8 @@ static void kc_sel_loop(void)
                if (inp & BTN_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }\r
                if (inp & BTN_PLAY) {\r
                        switch (menu_sel) {\r
-                               case 0: key_config_loop(ctrl_actions, is_6button ? 12 : 8, 0); return;\r
-                               case 1: key_config_loop(ctrl_actions, is_6button ? 12 : 8, 1); return;\r
+                               case 0: key_config_loop(me_ctrl_actions, is_6button ? 12 : 8, 0); return;\r
+                               case 1: key_config_loop(me_ctrl_actions, is_6button ? 12 : 8, 1); return;\r
                                case 2: key_config_loop(emuctrl_actions,\r
                                                sizeof(emuctrl_actions)/sizeof(emuctrl_actions[0]), -1); return;\r
                                case 3: if (!rom_loaded) emu_WriteConfig(0); return;\r