psp bugfixes, refactoring, stuff
[picodrive.git] / platform / gp2x / emu.c
index 63b2d04..41187c5 100644 (file)
@@ -105,7 +105,7 @@ static void find_combos(void)
        for (act = 0; act < 32; act++)\r
        {\r
                int keyc = 0;\r
-               if (act == 16) continue; // player2 flag\r
+               if (act == 16 || act == 17) continue; // player2 flag\r
                for (u = 0; u < 32; u++)\r
                {\r
                        if (currentConfig.KeyBinds[u] & (1 << act)) keyc++;\r
@@ -229,10 +229,9 @@ void osd_text(int x, int y, const char *text)
 \r
 static void cd_leds(void)\r
 {\r
-       // mmu problems?\r
 //     static\r
        int old_reg;\r
-//     if (!((Pico_mcd->s68k_regs[0] ^ old_reg) & 3)) return; // no change\r
+//     if (!((Pico_mcd->s68k_regs[0] ^ old_reg) & 3)) return; // no change // mmu hack problems?\r
        old_reg = Pico_mcd->s68k_regs[0];\r
 \r
        if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) {\r
@@ -252,7 +251,7 @@ static void cd_leds(void)
                unsigned int col_r = (old_reg & 1) ? 0xc000c000 : 0;\r
                *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2;\r
                *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2;\r
-               *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2;\r
+               *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r;\r
        }\r
 }\r
 \r
@@ -630,7 +629,7 @@ static void simpleWait(int thissec, int lim_time)
 void emu_Loop(void)\r
 {\r
        static int gp2x_old_clock = 200;\r
-       static int PsndRate_old = 0, PicoOpt_old = 0, EmuOpt_old = 0, PsndLen_real = 0, pal_old = 0;\r
+       static int PsndRate_old = 0, PicoOpt_old = 0, EmuOpt_old = 0, pal_old = 0;\r
        char fpsbuff[24]; // fps count c string\r
        struct timeval tval; // timing\r
        int thissec = 0, frames_done = 0, frames_shown = 0, oldmodes = 0;\r
@@ -683,7 +682,7 @@ void emu_Loop(void)
                                Reset940(1, 2);\r
                                Pause940(1);\r
                        }\r
-                       sound_rerate(Pico.m.frame_count ? 1 : 0);\r
+                       PsndRerate(Pico.m.frame_count ? 1 : 0);\r
                }\r
                snd_excess_add = ((PsndRate - PsndLen*target_fps)<<16) / target_fps;\r
                printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n",\r
@@ -694,7 +693,6 @@ void emu_Loop(void)
                memset(sndBuffer, 0, sizeof(sndBuffer));\r
                PsndOut = sndBuffer;\r
                PsndRate_old = PsndRate;\r
-               PsndLen_real = PsndLen;\r
                PicoOpt_old  = PicoOpt;\r
                pal_old = Pico.m.pal;\r
        } else {\r