32x: more wip
[libpicofe.git] / common / menu.c
index 08117df..1788033 100644 (file)
@@ -814,6 +814,11 @@ rescan:
                }\r
        }\r
 \r
+       /* make sure action buttons are not pressed on entering menu */\r
+       draw_dirlist(curr_path, namelist, n, sel);\r
+       while (in_menu_wait_any(50) & (PBTN_MOK|PBTN_MBACK|PBTN_MENU))\r
+               ;\r
+\r
        for (;;)\r
        {\r
                draw_dirlist(curr_path, namelist, n, sel);\r
@@ -1447,7 +1452,7 @@ static int menu_loop_adv_options(menu_id id, int keys)
 \r
 static int mh_opt_render(menu_id id, int keys)\r
 {\r
-       plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 1);\r
+       plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 0, 1);\r
        return 0;\r
 }\r
 \r
@@ -1747,11 +1752,12 @@ static void draw_text_debug(const char *str, int skip, int from)
 \r
 static void draw_frame_debug(void)\r
 {\r
-       char layer_str[48] = "layers:             ";\r
+       char layer_str[48] = "layers:                   ";\r
        if (PicoDrawMask & PDRAW_LAYERB_ON)      memcpy(layer_str +  8, "B", 1);\r
        if (PicoDrawMask & PDRAW_LAYERA_ON)      memcpy(layer_str + 10, "A", 1);\r
        if (PicoDrawMask & PDRAW_SPRITES_LOW_ON) memcpy(layer_str + 12, "spr_lo", 6);\r
        if (PicoDrawMask & PDRAW_SPRITES_HI_ON)  memcpy(layer_str + 19, "spr_hi", 6);\r
+       if (PicoDrawMask & PDRAW_32X_ON)         memcpy(layer_str + 26, "32x", 4);\r
 \r
        memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2);\r
        pemu_forced_frame(0);\r
@@ -1821,6 +1827,7 @@ static void debug_menu_loop(void)
                                if (inp & PBTN_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON;\r
                                if (inp & PBTN_DOWN)  PicoDrawMask ^= PDRAW_SPRITES_LOW_ON;\r
                                if (inp & PBTN_UP)    PicoDrawMask ^= PDRAW_SPRITES_HI_ON;\r
+                               if (inp & PBTN_MA2)   PicoDrawMask ^= PDRAW_32X_ON;\r
                                if (inp & PBTN_MOK) {\r
                                        PsndOut = NULL; // just in case\r
                                        PicoSkipFrame = 1;\r
@@ -1945,7 +1952,8 @@ void menu_loop(void)
                if (engineState == PGS_Menu)\r
                        engineState = PGS_Running;\r
                /* wait until menu, ok, back is released */\r
-               while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK));\r
+               while (in_menu_wait_any(50) & (PBTN_MENU|PBTN_MOK|PBTN_MBACK))\r
+                       ;\r
        }\r
 \r
        in_set_blocking(0);\r