bugfix, sprites adjustment
[picodrive.git] / platform / gizmondo / menu.c
index d461286..33c6fc0 100644 (file)
@@ -48,16 +48,17 @@ static unsigned int inp_prev = 0;
 \r
 static unsigned long wait_for_input(unsigned int interesting)\r
 {\r
-       unsigned int ret;\r
-       static int repeats = 0, wait = 50;\r
+       unsigned long ret;\r
+       static int repeats = 0, wait = 20;\r
        int release = 0, i;\r
 \r
-       if (repeats == 2 || repeats == 4) wait /= 2;\r
-       if (repeats == 6) wait = 15;\r
+       if      (repeats == 2) wait = 3;\r
+       else if (repeats == 4) wait = 2;\r
+       else if (repeats == 6) wait = 1;\r
 \r
-       for (i = 0; i < 6 && inp_prev == Framework_PollGetButtons(); i++) {\r
+       for (i = 0; i < wait && inp_prev == Framework_PollGetButtons(); i++) {\r
                if (i == 0) repeats++;\r
-               Sleep(wait);\r
+               Sleep(30);\r
        }\r
 \r
        while ( !((ret = Framework_PollGetButtons()) & interesting) ) {\r
@@ -67,8 +68,10 @@ static unsigned long wait_for_input(unsigned int interesting)
 \r
        if (release || ret != inp_prev) {\r
                repeats = 0;\r
-               wait = 50;\r
+               wait = 20;\r
        }\r
+       if (wait > 6 && (ret&(BTN_UP|BTN_LEFT|BTN_DOWN|BTN_RIGHT|BTN_L|BTN_R)))\r
+               wait = 6;\r
        inp_prev = ret;\r
 \r
        // we don't need diagonals in menus\r
@@ -561,7 +564,7 @@ static void draw_savestate_bg(int slot)
        }\r
 \r
        if (file) {\r
-               if (PicoMCD & 1) {\r
+               if (PicoAHW & 1) {\r
                        PicoCdLoadStateGfx(file);\r
                } else {\r
                        areaSeek(file, 0x10020, SEEK_SET);  // skip header and RAM in state file\r
@@ -575,7 +578,7 @@ static void draw_savestate_bg(int slot)
                areaClose(file);\r
        }\r
 \r
-       emu_forcedFrame();\r
+       emu_forcedFrame(POPT_EN_SOFTSCALE);\r
        menu_prepare_bg(1);\r
 \r
        memcpy(Pico.vram, tmp_vram, sizeof(Pico.vram));\r
@@ -921,9 +924,9 @@ static void cd_menu_loop_options(void)
                            selected_id == MA_CDOPT_READAHEAD) {\r
                                if (inp & BTN_LEFT) {\r
                                        PicoCDBuffers >>= 1;\r
-                                       if (PicoCDBuffers < 64) PicoCDBuffers = 0;\r
+                                       if (PicoCDBuffers < 2) PicoCDBuffers = 0;\r
                                } else {\r
-                                       if (PicoCDBuffers < 64) PicoCDBuffers = 64;\r
+                                       if (PicoCDBuffers < 2) PicoCDBuffers = 2;\r
                                        else PicoCDBuffers <<= 1;\r
                                        if (PicoCDBuffers > 8*1024) PicoCDBuffers = 8*1024; // 16M\r
                                }\r
@@ -969,6 +972,7 @@ static void cd_menu_loop_options(void)
 \r
 menu_entry opt2_entries[] =\r
 {\r
+       { "Disable sprite limit",      MB_ONOFF, MA_OPT2_NO_SPRITE_LIM, &PicoOpt, 0x40000, 0, 0, 1, 1 },\r
        { "Emulate Z80",               MB_ONOFF, MA_OPT2_ENABLE_Z80,    &currentConfig.PicoOpt,0x0004, 0, 0, 1 },\r
        { "Emulate YM2612 (FM)",       MB_ONOFF, MA_OPT2_ENABLE_YM2612, &currentConfig.PicoOpt,0x0001, 0, 0, 1 },\r
        { "Emulate SN76496 (PSG)",     MB_ONOFF, MA_OPT2_ENABLE_SN76496,&currentConfig.PicoOpt,0x0002, 0, 0, 1 },\r
@@ -1041,7 +1045,6 @@ menu_entry opt_entries[] =
        { NULL,                        MB_NONE,  MA_OPT_RENDERER,      NULL, 0, 0, 0, 1 },\r
        { "Scanline mode (faster)",    MB_ONOFF, MA_OPT_INTERLACED,    &currentConfig.EmuOpt,  0x4000, 0, 0, 1 },\r
        { "Scale low res mode",        MB_ONOFF, MA_OPT_SCALING,       &currentConfig.scaling, 0x0001, 0, 3, 1 },\r
-       { "Accurate timing (slower)",  MB_ONOFF, MA_OPT_ACC_TIMING,    &currentConfig.PicoOpt, 0x0040, 0, 0, 1 },\r
        { "Accurate sprites (slower)", MB_ONOFF, MA_OPT_ACC_SPRITES,   &currentConfig.PicoOpt, 0x0080, 0, 0, 1 },\r
        { "Show FPS",                  MB_ONOFF, MA_OPT_SHOW_FPS,      &currentConfig.EmuOpt,  0x0002, 0, 0, 1 },\r
        { NULL,                        MB_RANGE, MA_OPT_FRAMESKIP,     &currentConfig.Frameskip, 0, -1, 16, 1 },\r
@@ -1224,7 +1227,7 @@ static int menu_loop_options(void)
                                                        currentConfig.PsndRate =  11025;\r
                                                        currentConfig.PicoOpt |=  8;\r
                                                } else if ((inp & BTN_LEFT) && currentConfig.PsndRate == 11025 &&\r
-                                                               (currentConfig.PicoOpt&0x08) && !(PicoMCD&1))\r
+                                                               (currentConfig.PicoOpt&0x08) && !(PicoAHW&1))\r
                                                {\r
                                                        currentConfig.PsndRate =  44100;\r
                                                        currentConfig.PicoOpt &= ~8;\r
@@ -1311,10 +1314,10 @@ static int menu_loop_options(void)
 \r
 static void draw_menu_credits(void)\r
 {\r
-       int tl_x = 15, tl_y = 64, y;\r
+       int tl_x = 15, tl_y = 56, y;\r
        menu_draw_begin(1);\r
 \r
-       text_out16(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006,2007");\r
+       text_out16(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006-2008");\r
 \r
        y = tl_y;\r
        text_out16(tl_x, y, "Credits:");\r
@@ -1322,14 +1325,16 @@ static void draw_menu_credits(void)
        text_out16(tl_x, (y+=10), "      base code of PicoDrive");\r
        text_out16(tl_x, (y+=10), "Reesy & FluBBa: DrZ80 core");\r
        text_out16(tl_x, (y+=10), "MAME devs: YM2612 and SN76496 cores");\r
-       text_out16(tl_x, (y+=10), "Charles MacDonald: Genesis hw docs");\r
-       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: 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
+       text_out16(tl_x, (y+=20), "special thanks (for docs, ideas)");\r
+       text_out16(tl_x, (y+=10), " Charles MacDonald, Haze,");\r
+       text_out16(tl_x, (y+=10), " Stephane Dallongeville,");\r
+       text_out16(tl_x, (y+=10), " Lordus, Exophase, Rokas,");\r
+       text_out16(tl_x, (y+=10), " Nemesis, Tasco Deluxe");\r
+\r
        menu_draw_end();\r
 }\r
 \r
@@ -1429,6 +1434,7 @@ static void menu_loop_root(void)
                                        if (rom_loaded) {\r
                                                if(savestate_menu_loop(1))\r
                                                        continue;\r
+                                               while (Framework_PollGetButtons() & BTN_PLAY) Sleep(50);\r
                                                engineState = PGS_Running;\r
                                                return;\r
                                        }\r
@@ -1436,6 +1442,7 @@ static void menu_loop_root(void)
                                case MA_MAIN_RESET_GAME:\r
                                        if (rom_loaded) {\r
                                                emu_ResetGame();\r
+                                               while (Framework_PollGetButtons() & BTN_PLAY) Sleep(50);\r
                                                engineState = PGS_Running;\r
                                                return;\r
                                        }\r
@@ -1617,10 +1624,11 @@ int menu_loop_tray(void)
                                case 0: // select image\r
                                        selfname = romsel_loop(curr_path);\r
                                        if (selfname) {\r
-                                               int ret = -1, cd_type;\r
+                                               int ret = -1;\r
+                                               cd_img_type cd_type;\r
                                                cd_type = emu_cdCheck(NULL);\r
-                                               if (cd_type > 0)\r
-                                                       ret = Insert_CD(romFileName, cd_type == 2);\r
+                                               if (cd_type != CIT_NOT_CD)\r
+                                                       ret = Insert_CD(romFileName, cd_type);\r
                                                if (ret != 0) {\r
                                                        sprintf(menuErrorMsg, "Load failed, invalid CD image?");\r
                                                        lprintf("%s\n", menuErrorMsg);\r