various pre-release tweaks
authornotaz <notasas@gmail.com>
Mon, 3 Aug 2009 20:56:30 +0000 (20:56 +0000)
committernotaz <notasas@gmail.com>
Mon, 3 Aug 2009 20:56:30 +0000 (20:56 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@729 be3aeb3a-fb24-0410-a615-afba39da0efa

platform/common/emu.c
platform/common/menu.c
platform/gp2x/emu.c
platform/gp2x/plat.c

index 7c406b5..cee9f2d 100644 (file)
@@ -25,6 +25,8 @@
 #include <zlib/zlib.h>\r
 \r
 \r
+#define STATUS_MSG_TIMEOUT 2000\r
+\r
 void *g_screen_ptr;\r
 \r
 #if !SCREEN_SIZE_FIXED\r
@@ -92,23 +94,29 @@ static void get_ext(char *file, char *ext)
 void emu_status_msg(const char *format, ...)\r
 {\r
        va_list vl;\r
+       int ret;\r
 \r
        va_start(vl, format);\r
-       vsnprintf(noticeMsg, sizeof(noticeMsg), format, vl);\r
+       ret = vsnprintf(noticeMsg, sizeof(noticeMsg), format, vl);\r
        va_end(vl);\r
 \r
+       /* be sure old text gets overwritten */\r
+       for (; ret < 28; ret++)\r
+               noticeMsg[ret] = ' ';\r
+       noticeMsg[ret] = 0;\r
+\r
        notice_msg_time = plat_get_ticks_ms();\r
 }\r
 \r
-static const char *biosfiles_us[] = { "us_scd1_9210", "us_scd2_9306", "SegaCDBIOS9303" };\r
-static const char *biosfiles_eu[] = { "eu_mcd1_9210", "eu_mcd2_9306", "eu_mcd2_9303"   };\r
-static const char *biosfiles_jp[] = { "jp_mcd1_9112", "jp_mcd1_9111" };\r
+static const char * const biosfiles_us[] = { "us_scd1_9210", "us_scd2_9306", "SegaCDBIOS9303" };\r
+static const char * const biosfiles_eu[] = { "eu_mcd1_9210", "eu_mcd2_9306", "eu_mcd2_9303"   };\r
+static const char * const biosfiles_jp[] = { "jp_mcd1_9112", "jp_mcd1_9111" };\r
 \r
 static int find_bios(int region, char **bios_file)\r
 {\r
        static char bios_path[1024];\r
        int i, count;\r
-       const char **files;\r
+       const char * const *files;\r
        FILE *f = NULL;\r
 \r
        if (region == 4) { // US\r
@@ -924,7 +932,7 @@ int emu_save_load_game(int load, int sram)
                }\r
                else    ret = -1;\r
                if (!ret)\r
-                       emu_status_msg(load ? "GAME LOADED" : "GAME SAVED");\r
+                       emu_status_msg(load ? "STATE LOADED" : "STATE SAVED");\r
                else\r
                {\r
                        emu_status_msg(load ? "LOAD FAILED" : "SAVE FAILED");\r
@@ -1086,7 +1094,7 @@ static void run_events_ui(unsigned int which)
                        in_set_blocking(0);\r
                }\r
                if (do_it) {\r
-                       plat_status_msg_busy_first((which & PEV_STATE_LOAD) ? "LOADING GAME" : "SAVING GAME");\r
+                       plat_status_msg_busy_first((which & PEV_STATE_LOAD) ? "LOADING STATE" : "SAVING STATE");\r
                        PicoStateProgressCB = plat_status_msg_busy_next;\r
                        emu_save_load_game((which & PEV_STATE_LOAD) ? 1 : 0, 0);\r
                        PicoStateProgressCB = NULL;\r
@@ -1276,7 +1284,7 @@ void emu_loop(void)
                if (notice_msg_time != 0)\r
                {\r
                        static int noticeMsgSum;\r
-                       if (timestamp - ms_to_ticks(notice_msg_time) > ms_to_ticks(2000)) {\r
+                       if (timestamp - ms_to_ticks(notice_msg_time) > ms_to_ticks(STATUS_MSG_TIMEOUT)) {\r
                                notice_msg_time = 0;\r
                                plat_status_msg_clear();\r
                                notice_msg = NULL;\r
@@ -1330,6 +1338,10 @@ void emu_loop(void)
                        else {\r
                                pframes_done -= target_fps;\r
                                /* don't allow it to drift during heavy slowdowns */\r
+                               if (pframes_done < -5) {\r
+                                       reset_timing = 1;\r
+                                       continue;\r
+                               }\r
                                if (pframes_done < -2)\r
                                        pframes_done = -2;\r
                        }\r
@@ -1358,7 +1370,7 @@ void emu_loop(void)
                else if (diff > diff_lim)\r
                {\r
                        /* no time left for this frame - skip */\r
-                       if (diff - diff_lim >= ms_to_ticks(300)) {\r
+                       if (diff - diff_lim >= ms_to_ticks(200)) {\r
                                /* if too much behind, reset instead */\r
                                reset_timing = 1;\r
                                continue;\r
index e679f5e..5fc2a57 100644 (file)
@@ -2043,6 +2043,8 @@ void menu_plat_setup(int is_wiz)
 \r
        if (!is_wiz) {\r
                me_enable(e_menu_gfx_options, MA_OPT_TEARING_FIX, 0);\r
+               i = me_id2offset(e_menu_gfx_options, MA_OPT_TEARING_FIX);\r
+               e_menu_gfx_options[i].need_to_save = 0;\r
                return;\r
        }\r
 \r
@@ -2052,6 +2054,8 @@ void menu_plat_setup(int is_wiz)
 \r
        i = me_id2offset(e_menu_gfx_options, MA_OPT_SCALING);\r
        e_menu_gfx_options[i].max = 1;  /* only off and sw */\r
+       i = me_id2offset(e_menu_gfx_options, MA_OPT_ARM940_SOUND);\r
+       e_menu_gfx_options[i].need_to_save = 0;\r
 }\r
 \r
 /* TODO: rename */\r
index 0700e81..82f1c1d 100644 (file)
@@ -576,7 +576,7 @@ void plat_update_volume(int has_changed, int is_up)
                prev_frame = Pico.m.frame_count;\r
        }\r
 \r
-       if (need_low_volume)\r
+       if (!need_low_volume)\r
                return;\r
 \r
        /* set the right mixer func */\r
index aa60412..fe7b6fa 100644 (file)
@@ -160,6 +160,7 @@ void plat_init(void)
        {
        case SOCID_MMSP2:
                mmsp2_init();
+               menu_plat_setup(0);
                break;
        case SOCID_POLLUX:
                pollux_init();