return i;\r
}\r
\r
-static const char *menu_loop_romsel(char *curr_path, int len,\r
+static const char *menu_loop_romsel_d(char *curr_path, int len,\r
const char **filter_exts,\r
int (*extra_filter)(struct dirent **namelist, int count,\r
- const char *basedir))\r
+ const char *basedir),\r
+ void (*draw_prep)(void))\r
{\r
static char rom_fname_reload[256]; // used for scratch and return\r
char sel_fname[256];\r
curr_path_restore = p;\r
snprintf(sel_fname, sizeof(sel_fname), "%s", p + 1);\r
}\r
-\r
- if (rom_fname_reload[0] == 0)\r
- show_help = 2;\r
}\r
+ show_help = 2;\r
\r
rescan:\r
if (namelist != NULL) {\r
+ n += !n;\r
while (n-- > 0)\r
free(namelist[n]);\r
free(namelist);\r
\r
for (;;)\r
{\r
+ if (draw_prep != NULL)\r
+ draw_prep();\r
draw_dirlist(curr_path, namelist, n, sel, show_help);\r
inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT\r
| PBTN_L|PBTN_R|PBTN_MA2|PBTN_MA3|PBTN_MOK|PBTN_MBACK\r
g_menu_filter_off = !g_menu_filter_off;\r
snprintf(sel_fname, sizeof(sel_fname), "%s",\r
namelist[sel]->d_name);\r
+ show_help = 2;\r
goto rescan;\r
}\r
int last = n ? n-1 : 0;\r
strcat(newdir, "/");\r
strcat(newdir, namelist[sel]->d_name);\r
}\r
- ret = menu_loop_romsel(newdir, newlen, filter_exts, extra_filter);\r
+ ret = menu_loop_romsel_d(newdir, newlen, filter_exts, extra_filter, draw_prep);\r
free(newdir);\r
break;\r
}\r
return ret;\r
}\r
\r
+static const char *menu_loop_romsel(char *curr_path, int len,\r
+ const char **filter_exts,\r
+ int (*extra_filter)(struct dirent **namelist, int count,\r
+ const char *basedir))\r
+{\r
+ return menu_loop_romsel_d(curr_path, len, filter_exts, extra_filter, NULL);\r
+}\r
+\r
// ------------ savestate loader ------------\r
\r
#define STATE_SLOT_COUNT 10\r