giz renderers and stuff
[picodrive.git] / platform / gizmondo / menu.c
index 5e4aa8f..ff1a3da 100644 (file)
@@ -33,7 +33,7 @@
 #define gizKeyUnkn "???"\r
 static const char * const gizKeyNames[] = {\r
        "LEFT",          "RIGHT",          "UP",       "DOWN",     "STOP",       "PLAY",   "FORWARD",  "REWIND",\r
-       "LEFT_SHOULDER", "RIGHT_SHOULDER", "HOME",     "VOLUME",   "BRIGHTNESS", "ALARM",  "POWER",    gizKeyUnkn,\r
+       "L",             "R",              "HOME",     "VOLUME",   "BRIGHTNESS", "ALARM",  "POWER",    gizKeyUnkn,\r
        gizKeyUnkn,      gizKeyUnkn,       gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn,\r
        gizKeyUnkn,      gizKeyUnkn,       gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn\r
 };\r
@@ -116,7 +116,7 @@ static void load_progress_cb(int percent)
        dst = (unsigned short *)menu_screen + 321*20;\r
 \r
        if (len > 320) len = 320;\r
-       for (ln = 10; ln > 0; ln--, dst += 320)\r
+       for (ln = 10; ln > 0; ln--, dst += 321)\r
                memset(dst, 0xff, len*2);\r
        menu_draw_end();\r
 }\r
@@ -683,13 +683,13 @@ static void draw_key_config(const bind_action_t *opts, int opt_cnt, int player_i
 \r
        if (sel < opt_cnt) {\r
                text_out16(30, 180, "Press a button to bind/unbind");\r
-               text_out16(30, 190, "Use SELECT to clear");\r
-               text_out16(30, 200, "To bind UP/DOWN, hold SELECT");\r
+               text_out16(30, 190, "Use HOME to clear");\r
+               text_out16(30, 200, "To bind UP/DOWN, hold HOME");\r
                text_out16(30, 210, "Select \"Done\" to exit");\r
        } else {\r
                text_out16(30, 190, "Use Options -> Save cfg");\r
                text_out16(30, 200, "to save controls");\r
-               text_out16(30, 210, "Press B or X to exit");\r
+               text_out16(30, 210, "Press PLAY or STOP to exit");\r
        }\r
        menu_draw_end();\r
 }\r
@@ -702,7 +702,7 @@ static void key_config_loop(const bind_action_t *opts, int opt_cnt, int player_i
        for (;;)\r
        {\r
                draw_key_config(opts, opt_cnt, player_idx, sel);\r
-               inp = wait_for_input(CONFIGURABLE_KEYS);\r
+               inp = wait_for_input(CONFIGURABLE_KEYS|BTN_HOME);\r
                if (!(inp & BTN_HOME)) {\r
                        prev_select = 0;\r
                        if(inp & BTN_UP  ) { sel--; if (sel < 0) sel = menu_sel_max; continue; }\r
@@ -777,7 +777,6 @@ static bind_action_t emuctrl_actions[] =
        { "Switch Renderer", 1<<26 },\r
        { "Volume Down    ", 1<<30 },\r
        { "Volume Up      ", 1<<29 },\r
-       { "Enter Menu     ", 1<<23 },\r
 };\r
 \r
 static void kc_sel_loop(void)\r
@@ -1002,7 +1001,7 @@ static void amenu_loop_options(void)
                if (inp & (BTN_LEFT|BTN_RIGHT)) { // multi choise\r
                        if (!me_process(opt2_entries, OPT2_ENTRY_COUNT, selected_id, (inp&BTN_RIGHT) ? 1 : 0) &&\r
                            selected_id == MA_OPT2_GAMMA) {\r
-                               while ((inp = Framework_PollGetButtons(1)) & (BTN_LEFT|BTN_RIGHT)) {\r
+                               while ((inp = Framework_PollGetButtons()) & (BTN_LEFT|BTN_RIGHT)) {\r
                                        currentConfig.gamma += (inp & BTN_LEFT) ? -1 : 1;\r
                                        if (currentConfig.gamma <   1) currentConfig.gamma =   1;\r
                                        if (currentConfig.gamma > 300) currentConfig.gamma = 300;\r
@@ -1314,6 +1313,7 @@ static void draw_menu_credits(void)
        menu_draw_begin(1);\r
 \r
        text_out16(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006,2007");\r
+text_out16(tl_x, 30, "alpha1");\r
        y = tl_y;\r
        text_out16(tl_x, y, "Credits:");\r
        text_out16(tl_x, (y+=10), "Dave: Cyclone 68000 core,");\r
@@ -1324,8 +1324,8 @@ static void draw_menu_credits(void)
        text_out16(tl_x, (y+=10), "Stephane Dallongeville:");\r
        text_out16(tl_x, (y+=10), "      opensource Gens");\r
        text_out16(tl_x, (y+=10), "Haze: Genesis hw info");\r
-       text_out16(tl_x, (y+=10), "Reesy: TODO");\r
-       text_out16(tl_x, (y+=10), "TODO: gizmondo hardware");\r
+       text_out16(tl_x, (y+=10), "Reesy: kgsdk wrapper, sound code");\r
+       text_out16(tl_x, (y+=10), "jens.l: gizmondo hardware");\r
        text_out16(tl_x, (y+=10), "ketchupgun: skin design");\r
 \r
        menu_draw_end();\r
@@ -1389,7 +1389,7 @@ static void menu_loop_root(void)
        /* make sure action buttons are not pressed on entering menu */\r
        draw_menu_root(menu_sel);\r
 \r
-       while (Framework_PollGetButtons(1) & (BTN_PLAY|BTN_STOP|BTN_HOME)) Sleep(50);\r
+       while (Framework_PollGetButtons() & (BTN_PLAY|BTN_STOP|BTN_HOME)) Sleep(50);\r
 \r
        for (;;)\r
        {\r
@@ -1399,7 +1399,7 @@ static void menu_loop_root(void)
                if(inp & BTN_DOWN)  { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }\r
                if(inp &(BTN_HOME|BTN_STOP)){\r
                        if (rom_data) {\r
-                               while (Framework_PollGetButtons(1) & (BTN_HOME|BTN_STOP)) Sleep(50); // wait until select is released\r
+                               while (Framework_PollGetButtons() & (BTN_HOME|BTN_STOP)) Sleep(50); // wait until released\r
                                engineState = PGS_Running;\r
                                break;\r
                        }\r
@@ -1409,7 +1409,7 @@ static void menu_loop_root(void)
                        {\r
                                case MA_MAIN_RESUME_GAME:\r
                                        if (rom_data) {\r
-                                               while (Framework_PollGetButtons(1) & BTN_PLAY) Sleep(50);\r
+                                               while (Framework_PollGetButtons() & BTN_PLAY) Sleep(50);\r
                                                engineState = PGS_Running;\r
                                                return;\r
                                        }\r
@@ -1519,10 +1519,13 @@ static void menu_prepare_bg(int use_game_bg)
        if (use_game_bg)\r
        {\r
                // darken the active framebuffer\r
-               // TODO: take from somewhere else, not giz_screen\r
+               if (giz_screen == NULL)\r
+                       giz_screen = Framework2D_LockBuffer();\r
                memset(bg_buffer, 0, 321*8*2);\r
                menu_darken_bg(bg_buffer + 321*8*2, (char *)giz_screen + 321*8*2, 321*224, 1);\r
                memset(bg_buffer + 321*232*2, 0, 321*8*2);\r
+               Framework2D_UnlockBuffer();\r
+               giz_screen = NULL;\r
        }\r
        else\r
        {\r
@@ -1598,7 +1601,7 @@ int menu_loop_tray(void)
 \r
        /* make sure action buttons are not pressed on entering menu */\r
        draw_menu_tray(menu_sel);\r
-       while (Framework_PollGetButtons(1) & BTN_PLAY) Sleep(50);\r
+       while (Framework_PollGetButtons() & BTN_PLAY) Sleep(50);\r
 \r
        for (;;)\r
        {\r