X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Femu.c;fp=gp2x%2Femu.c;h=4addd460aabb30e301f393382d60a37829b49a19;hb=a33164fffe6463cd0aa698fac2bcc1fc213af18e;hp=659d3a719245e91a4a729c5670ef85cb9325e5dd;hpb=b6eccda3174977ced5e654b2278dd24381c713d8;p=libpicofe.git diff --git a/gp2x/emu.c b/gp2x/emu.c index 659d3a7..4addd46 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -710,18 +710,13 @@ void plat_update_volume(int has_changed, int is_up) } } -static void updateSound(int len) +static void oss_write_nonblocking(int len) { - len <<= 1; - if (PicoOpt & POPT_EN_STEREO) - len <<= 1; - + // sndout_oss_can_write() is not reliable, only use with no_frmlimit if ((currentConfig.EmuOpt & EOPT_NO_FRMLIMIT) && !sndout_oss_can_write(len)) return; - /* avoid writing audio when lagging behind to prevent audio lag */ - if (PicoSkipFrame != 2) - sndout_oss_write(PsndOut, len); + sndout_oss_write_nb(PsndOut, len); } void pemu_sound_start(void) @@ -739,7 +734,7 @@ void pemu_sound_start(void) memset(sndBuffer, 0, sizeof(sndBuffer)); PsndOut = sndBuffer; - PicoWriteSound = updateSound; + PicoWriteSound = oss_write_nonblocking; plat_update_volume(0, 0); printf("starting audio: %i len: %i stereo: %i, pal: %i\n", @@ -786,30 +781,16 @@ void pemu_sound_wait(void) void pemu_forced_frame(int no_scale, int do_emu) { - int po_old = PicoOpt; - - PicoOpt &= ~POPT_ALT_RENDERER; - PicoOpt |= POPT_ACC_SPRITES; - if (!no_scale) - PicoOpt |= POPT_EN_SOFTSCALE; - - memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4); - - PicoDrawSetOutFormat(PDF_RGB555, 1); + doing_bg_frame = 1; PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2); PicoDraw32xSetFrameMode(0, 0); PicoDrawSetCallbacks(NULL, NULL); Pico.m.dirtyPal = 1; - doing_bg_frame = 1; - if (do_emu) - PicoFrame(); - else - PicoFrameDrawOnly(); - doing_bg_frame = 0; + emu_cmn_forced_frame(no_scale, do_emu); g_menubg_src_ptr = g_screen_ptr; - PicoOpt = po_old; + doing_bg_frame = 0; } void plat_debug_cat(char *str)