X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fpandora%2Femu.c;h=0c6935b1b84e55f982eb9ae4bf61b6cebbf07827;hb=f8af96349ea464111fbef3c6528016c3dc34cdcf;hp=7c2af0326b77d5aebe660b0be6d83ef7810170ac;hpb=3bb7bd19cff9221f3c2b72a3a528b83932c3d4a9;p=picodrive.git diff --git a/platform/pandora/emu.c b/platform/pandora/emu.c index 7c2af03..0c6935b 100644 --- a/platform/pandora/emu.c +++ b/platform/pandora/emu.c @@ -48,7 +48,6 @@ char romFileName[PATH_MAX]; static short __attribute__((aligned(4))) sndBuffer[2*44100/50]; static struct timeval noticeMsgTime = { 0, 0 }; // when started showing static int osd_fps_x; -char noticeMsg[64]; // notice msg to draw unsigned char *PicoDraw2FB = NULL; // temporary buffer for alt renderer int reset_timing = 0; @@ -65,7 +64,7 @@ void emu_noticeMsgUpdated(void) gettimeofday(¬iceMsgTime, 0); } -void emu_getMainDir(char *dst, int len) +int emu_getMainDir(char *dst, int len) { extern char **g_argv; int j; @@ -76,6 +75,8 @@ void emu_getMainDir(char *dst, int len) dst[len] = 0; for (j = strlen(dst); j > 0; j--) if (dst[j] == '/') { dst[j+1] = 0; break; } + + return j + 1; } void emu_Init(void) @@ -135,12 +136,13 @@ void emu_Deinit(void) void emu_prepareDefaultConfig(void) { memset(&defaultConfig, 0, sizeof(defaultConfig)); - defaultConfig.EmuOpt = 0x9f | 0x00700; // | <- ram_tmng, confirm_save, cd_leds + defaultConfig.EmuOpt = 0x8f | 0x00600; // | <- confirm_save, cd_leds defaultConfig.s_PicoOpt = 0x0f | POPT_EXT_FM|POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_SVP_DRC; defaultConfig.s_PicoOpt |= POPT_ACC_SPRITES|POPT_EN_MCD_GFX; defaultConfig.s_PicoOpt &= ~POPT_EN_SVP_DRC; // crashes :( + defaultConfig.EmuOpt &= ~8; // no save gzip defaultConfig.s_PsndRate = 44100; - defaultConfig.s_PicoRegion = 0; // auto + defaultConfig.s_PicoRegion = 0; defaultConfig.s_PicoAutoRgnOrder = 0x184; // US, EU, JP defaultConfig.s_PicoCDBuffers = 0; defaultConfig.Frameskip = 0; @@ -150,16 +152,6 @@ void emu_prepareDefaultConfig(void) defaultConfig.turbo_rate = 15; } -void emu_setDefaultConfig(void) -{ - memcpy(¤tConfig, &defaultConfig, sizeof(currentConfig)); - PicoOpt = currentConfig.s_PicoOpt; - PsndRate = currentConfig.s_PsndRate; - PicoRegionOverride = currentConfig.s_PicoRegion; - PicoAutoRgnOrder = currentConfig.s_PicoAutoRgnOrder; - PicoCDBuffers = currentConfig.s_PicoCDBuffers; -} - static void textOut16(int x, int y, const char *text) { int i,l,len=strlen(text); @@ -358,7 +350,7 @@ static void blit(const char *fps, const char *notice) // 8bit accurate renderer if (Pico.m.dirtyPal) { - int pallen = 0x40; + int pallen = 0xc0; Pico.m.dirtyPal = 0; if (Pico.video.reg[0xC]&8) // shadow/hilight mode { @@ -368,13 +360,6 @@ static void blit(const char *fps, const char *notice) memcpy32(localPal+0xc0, localPal+0x40, 0x40); pallen = 0x100; } - else if (rendstatus & PDRAW_ACC_SPRITES) { - vidConvCpyRGB32(localPal, Pico.cram, 0x40); - memcpy32(localPal+0x40, localPal, 0x40); - memcpy32(localPal+0x80, localPal, 0x40); - memcpy32(localPal+0xc0, localPal, 0x40); - pallen = 0x100; - } else if (rendstatus & PDRAW_SONIC_MODE) { // mid-frame palette changes vidConvCpyRGB32(localPal, Pico.cram, 0x40); vidConvCpyRGB32(localPal+0x40, HighPal, 0x40); @@ -383,6 +368,7 @@ static void blit(const char *fps, const char *notice) } else { vidConvCpyRGB32(localPal, Pico.cram, 0x40); + memcpy32(localPal+0x80, localPal, 0x40); } if (pallen > 0xc0) { localPal[0xc0] = 0x0000c000; @@ -938,6 +924,7 @@ void emu_Loop(void) } bench_fps += frames_shown; sprintf(fpsbuff, "%3i/%3i/%3i", frames_shown, bench_fps_s, (bf[0]+bf[1]+bf[2]+bf[3])>>2); + printf("%s\n", fpsbuff); #else if (currentConfig.EmuOpt & 2) { sprintf(fpsbuff, "%3i/%3i", frames_shown, frames_done);