X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=common%2Fmenu.c;h=887e0cd71a1d9e4f6153b5d0908c09cc7c08d06d;hb=8ced8d2b38431e23be1b26457110febbe10d14c7;hp=688d5389b932bb20da19e3204255e4322df2253c;hpb=3d792006acf30d67362146f9f448f753064a6fcf;p=libpicofe.git diff --git a/common/menu.c b/common/menu.c index 688d538..887e0cd 100644 --- a/common/menu.c +++ b/common/menu.c @@ -22,10 +22,8 @@ #include #include -#define array_size(x) (sizeof(x) / sizeof(x[0])) - static char static_buff[64]; -static char menu_error_msg[64] = { 0, }; +char menu_error_msg[64] = { 0, }; static int menu_error_time = 0; #ifndef UIQ3 @@ -816,6 +814,11 @@ rescan: } } + /* make sure action buttons are not pressed on entering menu */ + draw_dirlist(curr_path, namelist, n, sel); + while (in_menu_wait_any(50) & (PBTN_MOK|PBTN_MBACK|PBTN_MENU)) + ; + for (;;) { draw_dirlist(curr_path, namelist, n, sel); @@ -1421,6 +1424,21 @@ static int menu_loop_cd_options(menu_id id, int keys) return 0; } +// ------------ 32X options menu ------------ + +static menu_entry e_menu_32x_options[] = +{ + mee_onoff("32X enabled", MA_32XOPT_ENABLE_32X, PicoOpt, POPT_EN_32X), + mee_onoff("PWM sound", MA_32XOPT_PWM, PicoOpt, POPT_EN_PWM), +}; + +static int menu_loop_32x_options(menu_id id, int keys) +{ + static int sel = 0; + me_loop(e_menu_32x_options, &sel, NULL); + return 0; +} + // ------------ adv options menu ------------ static menu_entry e_menu_adv_options[] = @@ -1449,7 +1467,7 @@ static int menu_loop_adv_options(menu_id id, int keys) static int mh_opt_render(menu_id id, int keys) { - plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 1); + plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 0, 1); return 0; } @@ -1669,6 +1687,7 @@ static menu_entry e_menu_options[] = mee_range (cpu_clk_name, MA_OPT_CPU_CLOCKS, currentConfig.CPUclock, 20, 900), mee_handler ("[Display options]", menu_loop_gfx_options), mee_handler ("[Sega/Mega CD options]", menu_loop_cd_options), + mee_handler ("[32X options]", menu_loop_32x_options), mee_handler ("[Advanced options]", menu_loop_adv_options), mee_handler_mkname_id(MA_OPT_SAVECFG, mh_saveloadcfg, mgn_savecfg), mee_handler_id("Save cfg for current game only", MA_OPT_SAVECFG_GAME, mh_saveloadcfg), @@ -1686,10 +1705,6 @@ static int menu_loop_options(menu_id id, int keys) me_loop(e_menu_options, &sel, NULL); - if (PicoRegionOverride) - // force setting possibly changed.. - Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0; - return 0; } @@ -1749,11 +1764,12 @@ static void draw_text_debug(const char *str, int skip, int from) static void draw_frame_debug(void) { - char layer_str[48] = "layers: "; + char layer_str[48] = "layers: "; if (PicoDrawMask & PDRAW_LAYERB_ON) memcpy(layer_str + 8, "B", 1); if (PicoDrawMask & PDRAW_LAYERA_ON) memcpy(layer_str + 10, "A", 1); if (PicoDrawMask & PDRAW_SPRITES_LOW_ON) memcpy(layer_str + 12, "spr_lo", 6); if (PicoDrawMask & PDRAW_SPRITES_HI_ON) memcpy(layer_str + 19, "spr_hi", 6); + if (PicoDrawMask & PDRAW_32X_ON) memcpy(layer_str + 26, "32x", 4); memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2); pemu_forced_frame(0); @@ -1793,19 +1809,23 @@ static void debug_menu_loop(void) g_screen_width, spr_offs); draw_text_debug(PDebugSpriteList(), spr_offs, 6); break; + case 4: plat_video_menu_begin(); + tmp = PDebug32x(); + draw_text_debug(tmp, 0, 0); + break; } plat_video_menu_end(); inp = in_menu_wait(PBTN_MOK|PBTN_MBACK|PBTN_MA2|PBTN_MA3|PBTN_L|PBTN_R | PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT, 70); if (inp & PBTN_MBACK) return; - if (inp & PBTN_L) { mode--; if (mode < 0) mode = 3; } - if (inp & PBTN_R) { mode++; if (mode > 3) mode = 0; } + if (inp & PBTN_L) { mode--; if (mode < 0) mode = 4; } + if (inp & PBTN_R) { mode++; if (mode > 4) mode = 0; } switch (mode) { case 0: if (inp & PBTN_MOK) - SekStepM68k(); + PDebugCPUStep(); if (inp & PBTN_MA3) { while (inp & PBTN_MA3) inp = in_menu_wait_any(-1); @@ -1823,6 +1843,7 @@ static void debug_menu_loop(void) if (inp & PBTN_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON; if (inp & PBTN_DOWN) PicoDrawMask ^= PDRAW_SPRITES_LOW_ON; if (inp & PBTN_UP) PicoDrawMask ^= PDRAW_SPRITES_HI_ON; + if (inp & PBTN_MA2) PicoDrawMask ^= PDRAW_32X_ON; if (inp & PBTN_MOK) { PsndOut = NULL; // just in case PicoSkipFrame = 1; @@ -1947,7 +1968,8 @@ void menu_loop(void) if (engineState == PGS_Menu) engineState = PGS_Running; /* wait until menu, ok, back is released */ - while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK)); + while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK)) + ; } in_set_blocking(0); @@ -2073,6 +2095,7 @@ static menu_entry *e_menu_table[] = e_menu_gfx_options, e_menu_adv_options, e_menu_cd_options, + e_menu_32x_options, e_menu_keyconfig, e_menu_hidden, };