various bugfixes
[picodrive.git] / platform / psp / menu.c
index 27cb28a..32c4115 100644 (file)
@@ -43,7 +43,7 @@ static unsigned short bg_buffer[480*272] __attribute__((aligned(16)));
 #define menu_screen psp_screen
 
 static void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
-static void menu_prepare_bg(int use_game_bg, int use_back_buff);
+static void menu_prepare_bg(int use_game_bg, int use_fg);
 
 
 static unsigned int inp_prev = 0;
@@ -190,10 +190,10 @@ static void draw_dirlist(char *curdir, struct my_dirent **namelist, int n, int s
                if (pos > 26) break;
                if (namelist[i+1]->d_type & DT_DIR) {
                        smalltext_out16_lim(14,   pos*10, "/", 0xd7ff, 1);
-                       smalltext_out16_lim(14+6, pos*10, namelist[i+1]->d_name, 0xd7ff, 53-3);
+                       smalltext_out16_lim(14+6, pos*10, namelist[i+1]->d_name, 0xd7ff, 80-3);
                } else {
                        unsigned short color = file2color(namelist[i+1]->d_name);
-                       smalltext_out16_lim(14,   pos*10, namelist[i+1]->d_name, color, 53-2);
+                       smalltext_out16_lim(14,   pos*10, namelist[i+1]->d_name, color, 80-2);
                }
        }
        text_out16(5, 130, ">");
@@ -552,7 +552,7 @@ static void draw_savestate_bg(int slot)
        }
 
        emu_forcedFrame();
-       menu_prepare_bg(1, 1);
+       menu_prepare_bg(1, 0);
 
        restore_oldstate(oldstate);
 }
@@ -1001,7 +1001,6 @@ static void menu_opt3_preview(int is_32col)
                void *bgdata = is_32col ? bgdatac32_start : bgdatac40_start;
                unsigned long insize = is_32col ? bgdatac32_size : bgdatac40_size, outsize = 65856;
                int ret;
-               lprintf("%p %p %i %i (n %p)\n", bgdatac32_start, bgdatac40_start, bgdatac32_size, bgdatac40_size, &engineState);
                ret = uncompress((Bytef *)bg_buffer, &outsize, bgdata, insize);
                if (ret == 0)
                {
@@ -1017,7 +1016,7 @@ static void menu_opt3_preview(int is_32col)
 
        memset32(psp_screen, 0, 512*272*2/4);
        emu_forcedFrame();
-       menu_prepare_bg(1, 1);
+       menu_prepare_bg(1, 0);
 
        if (oldstate) restore_oldstate(oldstate);
 }
@@ -1165,7 +1164,6 @@ static void amenu_loop_options(void)
 menu_entry opt_entries[] =
 {
        { NULL,                        MB_NONE,  MA_OPT_RENDERER,      NULL, 0, 0, 0, 1 },
-       { "Scale low res mode",        MB_ONOFF, MA_OPT_SCALING,       &currentConfig.scaling, 0x0001, 0, 3, 1 },
        { "Accurate timing (slower)",  MB_ONOFF, MA_OPT_ACC_TIMING,    &currentConfig.PicoOpt, 0x0040, 0, 0, 1 },
        { "Accurate sprites (slower)", MB_ONOFF, MA_OPT_ACC_SPRITES,   &currentConfig.PicoOpt, 0x0080, 0, 0, 1 },
        { "Show FPS",                  MB_ONOFF, MA_OPT_SHOW_FPS,      &currentConfig.EmuOpt,  0x0002, 0, 0, 1 },
@@ -1220,12 +1218,12 @@ static void menu_opt_cust_draw(const menu_entry *entry, int x, int y, void *para
        {
                case MA_OPT_RENDERER:
                        if (currentConfig.PicoOpt&0x10)
-                               str = " 8bit fast";
+                               str = "fast";
                        else if (currentConfig.EmuOpt&0x80)
-                               str = "16bit accurate";
+                               str = "accurate";
                        else
-                               str = " 8bit accurate";
-                       text_out16(x, y, "Renderer:            %s", str);
+                               str = " 8bit accurate"; // n/a
+                       text_out16(x, y, "Renderer:                  %s", str);
                        break;
                case MA_OPT_FRAMESKIP:
                        if (currentConfig.Frameskip < 0)
@@ -1355,31 +1353,16 @@ static int menu_loop_options(void)
                        if (!me_process(opt_entries, OPT_ENTRY_COUNT, selected_id, (inp&BTN_RIGHT) ? 1 : 0)) {
                                switch (selected_id) {
                                        case MA_OPT_RENDERER:
-                                               if (inp & BTN_LEFT) {
-                                                       if ((currentConfig.PicoOpt&0x10) || !(currentConfig.EmuOpt &0x80)) {
-                                                               currentConfig.PicoOpt&= ~0x10;
-                                                               currentConfig.EmuOpt |=  0x80;
-                                                       }
+                                               if ((currentConfig.PicoOpt&0x10) || !(currentConfig.EmuOpt &0x80)) {
+                                                       currentConfig.PicoOpt&= ~0x10;
+                                                       currentConfig.EmuOpt |=  0x80;
                                                } else {
-                                                       if (!(currentConfig.PicoOpt&0x10) || (currentConfig.EmuOpt &0x80)) {
-                                                               currentConfig.PicoOpt|=  0x10;
-                                                               currentConfig.EmuOpt &= ~0x80;
-                                                       }
+                                                       currentConfig.PicoOpt|=  0x10;
+                                                       currentConfig.EmuOpt &= ~0x80;
                                                }
                                                break;
                                        case MA_OPT_SOUND_QUALITY:
-                                               if ((inp & BTN_RIGHT) && currentConfig.PsndRate == 44100 &&
-                                                               !(currentConfig.PicoOpt&0x08))
-                                               {
-                                                       currentConfig.PsndRate =  11025;
-                                                       currentConfig.PicoOpt |=  8;
-                                               } else if ((inp & BTN_LEFT) && currentConfig.PsndRate == 11025 &&
-                                                               (currentConfig.PicoOpt&0x08) && !(PicoMCD&1))
-                                               {
-                                                       currentConfig.PsndRate =  44100;
-                                                       currentConfig.PicoOpt &= ~8;
-                                               } else
-                                                       currentConfig.PsndRate = sndrate_prevnext(currentConfig.PsndRate, inp & BTN_RIGHT);
+                                               currentConfig.PsndRate = sndrate_prevnext(currentConfig.PsndRate, inp & BTN_RIGHT);
                                                break;
                                        case MA_OPT_REGION:
                                                region_prevnext(inp & BTN_RIGHT);
@@ -1672,13 +1655,13 @@ static void menu_darken_bg(void *dst, const void *src, int pixels, int darker)
        }
 }
 
-static void menu_prepare_bg(int use_game_bg, int use_back_buff)
+static void menu_prepare_bg(int use_game_bg, int use_fg)
 {
        if (use_game_bg)
        {
                // darken the active framebuffer
                unsigned short *dst = bg_buffer;
-               unsigned short *src = use_back_buff ? psp_screen : psp_video_get_active_fb();
+               unsigned short *src = use_fg ? psp_video_get_active_fb() : psp_screen;
                int i;
                for (i = 272; i > 0; i--, dst += 480, src += 512)
                        menu_darken_bg(dst, src, 480, 1);
@@ -1695,7 +1678,7 @@ static void menu_prepare_bg(int use_game_bg, int use_back_buff)
 
 static void menu_gfx_prepare(void)
 {
-       menu_prepare_bg(rom_data != NULL, 0);
+       menu_prepare_bg(rom_data != NULL, 1);
 
        menu_draw_begin();
        menu_draw_end();