PSP sustend/resume and stuff
[libpicofe.git] / gp2x / menu.c
index a60e4d8..8b4968c 100644 (file)
@@ -133,17 +133,36 @@ static void menu_flip(void)
 \r
 // --------- loading ROM screen ----------\r
 \r
+static int cdload_called = 0;\r
+\r
 static void load_progress_cb(int percent)\r
 {\r
        int ln, len = percent * 320 / 100;\r
        unsigned short *dst = (unsigned short *)gp2x_screen + 320*20;\r
 \r
        if (len > 320) len = 320;\r
-       for (ln = 10; ln > 0; ln--, dst += 320)\r
+       for (ln = 8; ln > 0; ln--, dst += 320)\r
                memset(dst, 0xff, len*2);\r
        menu_flip();\r
 }\r
 \r
+static void cdload_progress_cb(int percent)\r
+{\r
+       int ln, len = percent * 320 / 100;\r
+       unsigned short *dst = (unsigned short *)gp2x_screen + 320*20;\r
+\r
+       memset(dst, 0xff, 320*2*8);\r
+\r
+       smalltext_out16(1, 3*10, "Processing CD image / MP3s", 0xffff);\r
+       smalltext_out16_lim(1, 4*10, romFileName, 0xffff, 80);\r
+       dst += 30;\r
+\r
+       if (len > 320) len = 320;\r
+       for (ln = 8; ln > 0; ln--, dst += 320)\r
+               memset(dst, 0xff, len*2);\r
+       cdload_called = 1;\r
+}\r
+\r
 void menu_romload_prepare(const char *rom_name)\r
 {\r
        const char *p = rom_name + strlen(rom_name);\r
@@ -157,12 +176,14 @@ void menu_romload_prepare(const char *rom_name)
        gp2x_memcpy_buffers(3, gp2x_screen, 0, 320*240*2);\r
        menu_flip();\r
        PicoCartLoadProgressCB = load_progress_cb;\r
+       PicoCDLoadProgressCB = cdload_progress_cb;\r
+       cdload_called = 0;\r
 }\r
 \r
 void menu_romload_end(void)\r
 {\r
        PicoCartLoadProgressCB = NULL;\r
-       smalltext_out16(1, 30, "Starting emulation...", 0xffff);\r
+       smalltext_out16(1, cdload_called ? 60 : 30, "Starting emulation...", 0xffff);\r
        menu_flip();\r
 }\r
 \r
@@ -172,7 +193,7 @@ void menu_romload_end(void)
 static unsigned short file2color(const char *fname)\r
 {\r
        const char *ext = fname + strlen(fname) - 3;\r
-       static const char *rom_exts[]   = { "zip", "bin", "smd", "gen", "iso" };\r
+       static const char *rom_exts[]   = { "zip", "bin", "smd", "gen", "iso", "cso" };\r
        static const char *other_exts[] = { "gmv", "pat" };\r
        int i;\r
 \r
@@ -1250,6 +1271,10 @@ static void menu_options_save(void)
        PicoOpt = currentConfig.PicoOpt;\r
        PsndRate = currentConfig.PsndRate;\r
        PicoRegionOverride = currentConfig.PicoRegion;\r
+       if (PicoRegionOverride) {\r
+               // force setting possibly changed..\r
+               Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0;\r
+       }\r
        if (!(PicoOpt & 0x20)) {\r
                // unbind XYZ MODE, just in case\r
                unbind_action(0xf00, -1, -1);\r
@@ -1394,7 +1419,7 @@ static void draw_menu_credits(void)
        text_out16(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006,2007");\r
        y = tl_y;\r
        text_out16(tl_x, y, "Credits:");\r
-       text_out16(tl_x, (y+=10), "Dave: Cyclone 68000 core,");\r
+       text_out16(tl_x, (y+=10), "fDave: Cyclone 68000 core,");\r
        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