X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flinux%2Femu.c;h=cf05dbcce5aba98be5d77aeae966de0bc7dab86c;hb=e743be2070a13d14cae39a55b815b62b0edb6776;hp=f5a21c3ee30f9a56a1583b916f186cfb605d602a;hpb=9f6a4e907bc86412c9279809d133e6e2fb896c0c;p=picodrive.git diff --git a/platform/linux/emu.c b/platform/linux/emu.c index f5a21c3..cf05dbc 100644 --- a/platform/linux/emu.c +++ b/platform/linux/emu.c @@ -6,11 +6,11 @@ #include #include +#include "../libpicofe/menu.h" +#include "../libpicofe/plat.h" +#include "../libpicofe/linux/sndout_oss.h" #include "../common/emu.h" -#include "../common/menu.h" -#include "../common/plat.h" #include "../common/arm_utils.h" -#include "../linux/sndout_oss.h" #include "version.h" #include @@ -210,47 +210,27 @@ void plat_update_volume(int has_changed, int is_up) void pemu_forced_frame(int no_scale, int do_emu) { - int po_old = PicoOpt; - - memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4); - - PicoOpt &= ~POPT_ALT_RENDERER; - PicoOpt |= POPT_ACC_SPRITES; - if (!no_scale) - PicoOpt |= POPT_EN_SOFTSCALE; - - PicoDrawSetOutFormat(PDF_RGB555, 1); PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2); PicoDraw32xSetFrameMode(0, 0); - + PicoDrawSetCallbacks(NULL, NULL); Pico.m.dirtyPal = 1; - if (do_emu) - PicoFrame(); - else - PicoFrameDrawOnly(); + + emu_cmn_forced_frame(no_scale, do_emu); g_menubg_src_ptr = g_screen_ptr; - PicoOpt = po_old; } -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) { - int target_fps = Pico.m.pal ? 50 : 60; - PsndOut = NULL; if (currentConfig.EmuOpt & EOPT_EN_SOUND) @@ -263,7 +243,7 @@ void pemu_sound_start(void) PsndRate, PsndLen, is_stereo, Pico.m.pal); sndout_oss_start(PsndRate, is_stereo, 1); sndout_oss_setvol(currentConfig.volume, currentConfig.volume); - PicoWriteSound = updateSound; + PicoWriteSound = oss_write_nonblocking; plat_update_volume(0, 0); memset(sndBuffer, 0, sizeof(sndBuffer)); PsndOut = sndBuffer; @@ -318,24 +298,3 @@ void plat_wait_till_us(unsigned int us_to) } } -const char *plat_get_credits(void) -{ - return "PicoDrive v" VERSION " (c) notaz, 2006-2009\n\n\n" - "Credits:\n" - "fDave: Cyclone 68000 core,\n" - " base code of PicoDrive\n" - "Reesy & FluBBa: DrZ80 core\n" - "MAME devs: YM2612 and SN76496 cores\n" - "rlyeh and others: minimal SDK\n" - "Squidge: mmuhack\n" - "Dzz: ARM940 sample\n" - "GnoStiC / Puck2099: USB joy code\n" - "craigix: GP2X hardware\n" - "ketchupgun: skin design\n" - "\n" - "special thanks (for docs, ideas):\n" - " Charles MacDonald, Haze,\n" - " Stephane Dallongeville,\n" - " Lordus, Exophase, Rokas,\n" - " Nemesis, Tasco Deluxe"; -}