X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Femu.c;h=3f2ed3fcfd26dfc3576cae01ae47e918da142c17;hb=91b2c3e133f883a1674b7acd7702c225f568bfa3;hp=8bd1b66ac3b5944c92861370822ee294b5c160d1;hpb=8ede36b95ea08e10f12e67a487c508a0c8993d6c;p=libpicofe.git diff --git a/gp2x/emu.c b/gp2x/emu.c index 8bd1b66..3f2ed3f 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -43,7 +43,7 @@ char romFileName[PATH_MAX]; extern int crashed_940; -static short sndBuffer[2*44100/50]; +static short __attribute__((aligned(4))) sndBuffer[2*44100/50]; static struct timeval noticeMsgTime = { 0, 0 }; // when started showing static int osd_fps_x; static int combo_keys = 0, combo_acts = 0; // keys and actions which need button combos @@ -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); } @@ -629,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; @@ -682,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", @@ -693,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 {