X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2Femu.c;h=825ab5bbcff0810ed2700b9abffbe1f5c71c6611;hb=86b38dc46d93354418faf5aecd430f8661adb4b3;hp=659d3a719245e91a4a729c5670ef85cb9325e5dd;hpb=9f6a4e907bc86412c9279809d133e6e2fb896c0c;p=picodrive.git diff --git a/platform/gp2x/emu.c b/platform/gp2x/emu.c index 659d3a7..825ab5b 100644 --- a/platform/gp2x/emu.c +++ b/platform/gp2x/emu.c @@ -43,8 +43,6 @@ extern int crashed_940; static short __attribute__((aligned(4))) sndBuffer[2*(44100+100)/50]; -static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)]; -unsigned char *PicoDraw2FB = PicoDraw2FB_; static int osd_fps_x, osd_y, doing_bg_frame; const char *renderer_names[] = { "16bit accurate", " 8bit accurate", " 8bit fast", NULL }; const char *renderer_names32x[] = { "accurate", "faster", "fastest", NULL }; @@ -67,8 +65,10 @@ void pemu_prep_defconfig(void) soc = soc_detect(); if (soc == SOCID_MMSP2) defaultConfig.s_PicoOpt |= POPT_EXT_FM; - else if (soc == SOCID_POLLUX) + else if (soc == SOCID_POLLUX) { defaultConfig.EmuOpt |= EOPT_WIZ_TEAR_FIX|EOPT_SHOW_RTC; + defaultConfig.s_PicoOpt |= POPT_EN_MCD_GFX; + } } void pemu_validate_config(void) @@ -522,11 +522,9 @@ static void vid_reset_mode(void) // Wiz 16bit is an exception, uses line rendering due to rotation mess if (renderer == RT_16BIT && (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX)) { PicoDrawSetOutFormat(PDF_RGB555, 1); - PicoDraw32xSetFrameMode(0, 0); } else { PicoDrawSetOutFormat(PDF_NONE, 0); - PicoDraw32xSetFrameMode(1, 0); } PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2); gp2x_mode = 16; @@ -710,18 +708,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 +732,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 +779,15 @@ 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) @@ -930,24 +908,3 @@ void pemu_loop_end(void) pemu_forced_frame(0, 1); } -const char *plat_get_credits(void) -{ - return "PicoDrive v" VERSION " (c) notaz, 2006-2010\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"; -}