\r
static void debug_menu_loop(void);\r
\r
-static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void))\r
+static int me_loop_d(menu_entry *menu, int *menu_sel, void (*draw_prep)(void), void (*draw_more)(void))\r
{\r
- int ret, inp, sel = *menu_sel, menu_sel_max;\r
+ int ret = 0, inp, sel = *menu_sel, menu_sel_max;\r
\r
menu_sel_max = me_count(menu) - 1;\r
if (menu_sel_max < 0) {\r
lprintf("no enabled menu entries\n");\r
- return;\r
+ return 0;\r
}\r
\r
while ((!menu[sel].enabled || !menu[sel].selectable) && sel < menu_sel_max)\r
\r
for (;;)\r
{\r
+ if (draw_prep != NULL)\r
+ draw_prep();\r
+\r
me_draw(menu, sel, draw_more);\r
inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT|\r
PBTN_MOK|PBTN_MBACK|PBTN_MENU|PBTN_L|PBTN_R, 70);\r
}\r
}\r
*menu_sel = sel;\r
+\r
+ return ret;\r
+}\r
+\r
+static int me_loop(menu_entry *menu, int *menu_sel)\r
+{\r
+ return me_loop_d(menu, menu_sel, NULL, NULL);\r
}\r
\r
/* ***************************************** */\r
return alphasort(d1, d2);\r
}\r
\r
-static const char *filter_exts[] = {\r
- ".mp3", ".MP3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html",\r
- ".jpg", ".gpe"\r
-};\r
-\r
static int scandir_filter(const struct dirent *ent)\r
{\r
const char *p;\r
return 0xffff;
}
+static const char *filter_exts[] = {
+ ".mp3", ".MP3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html",
+ ".jpg", ".gpe"
+};
+
#include "menu.c"
/* platform specific options and handlers */
static int sel = 0;
me_enable(e_menu_keyconfig, MA_OPT_SAVECFG_GAME, rom_loaded);
- me_loop(e_menu_keyconfig, &sel, NULL);
+ me_loop(e_menu_keyconfig, &sel);
return 0;
}
static int menu_loop_cd_options(int id, int keys)
{
static int sel = 0;
- me_loop(e_menu_cd_options, &sel, NULL);
+ me_loop(e_menu_cd_options, &sel);
return 0;
}
static int sel = 0;
me_enable(e_menu_32x_options, MA_32XOPT_RENDERER, renderer_names32x[0] != NULL);
- me_loop(e_menu_32x_options, &sel, NULL);
+ me_loop(e_menu_32x_options, &sel);
return 0;
}
static int menu_loop_adv_options(int id, int keys)
{
static int sel = 0;
- me_loop(e_menu_adv_options, &sel, NULL);
+ me_loop(e_menu_adv_options, &sel);
return 0;
}
static int sel = 0;
me_enable(e_menu_gfx_options, MA_OPT_RENDERER, renderer_names[0] != NULL);
- me_loop(e_menu_gfx_options, &sel, NULL);
+ me_loop(e_menu_gfx_options, &sel);
return 0;
}
me_enable(e_menu_options, MA_OPT_SAVECFG_GAME, rom_loaded);
me_enable(e_menu_options, MA_OPT_LOADCFG, config_slot != config_slot_current);
- me_loop(e_menu_options, &sel, NULL);
+ me_loop(e_menu_options, &sel);
return 0;
}
menu_enter(rom_loaded);
in_set_config_int(0, IN_CFG_BLOCKING, 1);
- me_loop(e_menu_main, &sel, menu_main_plat_draw);
+ me_loop_d(e_menu_main, &sel, NULL, menu_main_plat_draw);
if (rom_loaded) {
if (engineState == PGS_Menu)
menu_enter(rom_loaded);
in_set_config_int(0, IN_CFG_BLOCKING, 1);
- me_loop(e_menu_tray, &sel, NULL);
+ me_loop(e_menu_tray, &sel);
if (engineState != PGS_RestartRun) {
engineState = PGS_RestartRun;