X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fmenu.c;h=be822cfcba1fec8ef5ba907f6986610a5df18a9b;hb=f342bededbe5d51afd1632e689f5105e50d4f63e;hp=bcbbc1ca676c335fc934086612c0c2d46b7eded2;hpb=b6072c177f57cdcb32cfd5eee53b7c178f89c5d3;p=libpicofe.git diff --git a/pandora/menu.c b/pandora/menu.c index bcbbc1c..be822cf 100644 --- a/pandora/menu.c +++ b/pandora/menu.c @@ -7,10 +7,8 @@ static const char h_cscaler[] = "Displays the scaler layer, you can resize it\ "using d-pad or move it using R+d-pad"; static const char *men_dummy[] = { NULL }; char **pnd_filter_list; -int g_layer_cx = 80, g_layer_cy = 0; -int g_layer_cw = 640, g_layer_ch = 480; -static int menu_loop_cscaler(menu_id id, int keys) +static int menu_loop_cscaler(int id, int keys) { unsigned int inp; @@ -21,10 +19,10 @@ static int menu_loop_cscaler(menu_id id, int keys) for (;;) { - plat_video_menu_begin(); + menu_draw_begin(0); memset(g_menuscreen_ptr, 0, g_menuscreen_w * g_menuscreen_h * 2); text_out16(2, 480 - 18, "%dx%d | d-pad to resize, R+d-pad to move", g_layer_cw, g_layer_ch); - plat_video_menu_end(); + menu_draw_end(); inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT|PBTN_R|PBTN_MOK|PBTN_MBACK, 40); if (inp & PBTN_UP) g_layer_cy--; @@ -82,13 +80,14 @@ static int menu_loop_cscaler(menu_id id, int keys) static menu_entry e_menu_gfx_options[]; static menu_entry e_menu_options[]; +static menu_entry e_menu_keyconfig[]; void pnd_menu_init(void) { struct dirent *ent; int i, count = 0; char **mfilters; - char buff[64]; + char buff[64], *p; DIR *dir; dir = opendir("/etc/pandora/conf/dss_fir"); @@ -105,7 +104,8 @@ void pnd_menu_init(void) perror("readdir"); break; } - if (strstr(ent->d_name, "_up_h")) + p = strstr(ent->d_name, "_up"); + if (p != NULL && (p[3] == 0 || !strcmp(p + 3, "_h"))) count++; } @@ -118,14 +118,13 @@ void pnd_menu_init(void) rewinddir(dir); for (i = 0; (ent = readdir(dir)); ) { - char *pos; size_t len; - pos = strstr(ent->d_name, "_up_h"); - if (pos == NULL) + p = strstr(ent->d_name, "_up"); + if (p == NULL || (p[3] != 0 && strcmp(p + 3, "_h"))) continue; - len = pos - ent->d_name; + len = p - ent->d_name; if (len > sizeof(buff) - 1) continue; @@ -141,7 +140,9 @@ void pnd_menu_init(void) e_menu_gfx_options[i].data = (void *)mfilters; pnd_filter_list = mfilters; - i = me_id2offset(e_menu_options, MA_OPT_SCALING); - e_menu_options[i]->name = "Max CPU clock"; + i = me_id2offset(e_menu_options, MA_OPT_CPU_CLOCKS); + e_menu_options[i].name = "Max CPU clock"; + + me_enable(e_menu_keyconfig, MA_CTRL_DEADZONE, 0); }