X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Femu.c;h=701bcd81ebaf9b2b9df8c53e0ea1245139b960c6;hb=60a10527f24efc63bdca6815914a240d706236db;hp=63b2d047d0ee18268ad90c9414573ee89faecc60;hpb=f013066e974c7d35b818a6fca43a9deba1ce5c3e;p=libpicofe.git diff --git a/gp2x/emu.c b/gp2x/emu.c index 63b2d04..701bcd8 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -104,11 +104,22 @@ static void find_combos(void) combo_keys = combo_acts = 0; for (act = 0; act < 32; act++) { - int keyc = 0; - if (act == 16) continue; // player2 flag - for (u = 0; u < 32; u++) + int keyc = 0, keyc2 = 0; + if (act == 16 || act == 17) continue; // player2 flag + if (act > 17) { - if (currentConfig.KeyBinds[u] & (1 << act)) keyc++; + for (u = 0; u < 32; u++) + if (currentConfig.KeyBinds[u] & (1 << act)) keyc++; + } + else + { + for (u = 0; u < 32; u++) + if ((currentConfig.KeyBinds[u] & 0x30000) == 0 && // pl. 1 + (currentConfig.KeyBinds[u] & (1 << act))) keyc++; + for (u = 0; u < 32; u++) + if ((currentConfig.KeyBinds[u] & 0x30000) == 1 && // pl. 2 + (currentConfig.KeyBinds[u] & (1 << act))) keyc2++; + if (keyc2 > keyc) keyc = keyc2; } if (keyc > 1) { @@ -122,6 +133,7 @@ static void find_combos(void) } } } + // printf("combo keys/acts: %08x %08x\n", combo_keys, combo_acts); } @@ -229,10 +241,9 @@ void osd_text(int x, int y, const char *text) static void cd_leds(void) { - // mmu problems? // static int old_reg; -// if (!((Pico_mcd->s68k_regs[0] ^ old_reg) & 3)) return; // no change +// if (!((Pico_mcd->s68k_regs[0] ^ old_reg) & 3)) return; // no change // mmu hack problems? old_reg = Pico_mcd->s68k_regs[0]; if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) { @@ -252,7 +263,7 @@ static void cd_leds(void) unsigned int col_r = (old_reg & 1) ? 0xc000c000 : 0; *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2; *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2; - *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2; + *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; } } @@ -630,7 +641,7 @@ static void simpleWait(int thissec, int lim_time) void emu_Loop(void) { static int gp2x_old_clock = 200; - static int PsndRate_old = 0, PicoOpt_old = 0, EmuOpt_old = 0, PsndLen_real = 0, pal_old = 0; + static int PsndRate_old = 0, PicoOpt_old = 0, EmuOpt_old = 0, pal_old = 0; char fpsbuff[24]; // fps count c string struct timeval tval; // timing int thissec = 0, frames_done = 0, frames_shown = 0, oldmodes = 0; @@ -683,7 +694,7 @@ void emu_Loop(void) Reset940(1, 2); Pause940(1); } - sound_rerate(Pico.m.frame_count ? 1 : 0); + PsndRerate(Pico.m.frame_count ? 1 : 0); } snd_excess_add = ((PsndRate - PsndLen*target_fps)<<16) / target_fps; printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n", @@ -694,7 +705,6 @@ void emu_Loop(void) memset(sndBuffer, 0, sizeof(sndBuffer)); PsndOut = sndBuffer; PsndRate_old = PsndRate; - PsndLen_real = PsndLen; PicoOpt_old = PicoOpt; pal_old = Pico.m.pal; } else {