#include <Pico/Patch.h>\r
#include <zlib/zlib.h>\r
\r
+//#define PFRAMES\r
\r
#ifdef BENCHMARK\r
#define OSD_FPS_X 220\r
}\r
\r
// additional movie stuff\r
- if(movie_data) {\r
+ if (movie_data) {\r
if(movie_data[0x14] == '6')\r
PicoOpt |= 0x20; // 6 button pad\r
else PicoOpt &= ~0x20;\r
- PicoOpt |= 0x40; // accurate timing\r
+ PicoOpt |= 0x10040; // accurate timing, no VDP fifo timing\r
if(movie_data[0xF] >= 'A') {\r
if(movie_data[0x16] & 0x80) {\r
PicoRegionOverride = 8;\r
}\r
else\r
{\r
+ PicoOpt &= ~0x10000;\r
if(Pico.m.pal) {\r
strcpy(noticeMsg, "PAL SYSTEM / 50 FPS");\r
} else {\r
// prepare sound stuff\r
if(currentConfig.EmuOpt & 4) {\r
int snd_excess_add;\r
- if(PsndRate != PsndRate_old || (PicoOpt&0x20b) != (PicoOpt_old&0x20b) || Pico.m.pal != pal_old || crashed_940) {\r
+ if (PsndRate != PsndRate_old || (PicoOpt&0x20b) != (PicoOpt_old&0x20b) || Pico.m.pal != pal_old ||\r
+ ((PicoOpt&0x200) && crashed_940)) {\r
/* if 940 is turned off, we need it to be put back to sleep */\r
if (!(PicoOpt&0x200) && ((PicoOpt^PicoOpt_old)&0x200)) {\r
Reset940(1, 2);\r
Pause940(1);\r
}\r
- sound_rerate(1);\r
+ sound_rerate(Pico.m.frame_count ? 1 : 0);\r
}\r
- //excess_samples = PsndRate - PsndLen*target_fps;\r
snd_excess_add = ((PsndRate - PsndLen*target_fps)<<16) / target_fps;\r
- printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n", PsndRate, PsndLen, snd_excess_add, (PicoOpt&8)>>3, Pico.m.pal);\r
+ printf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n",\r
+ PsndRate, PsndLen, snd_excess_add, (PicoOpt&8)>>3, Pico.m.pal);\r
gp2x_start_sound(PsndRate, 16, (PicoOpt&8)>>3);\r
gp2x_sound_volume(currentConfig.volume, currentConfig.volume);\r
PicoWriteSound = updateSound;\r
if (frames_shown > frames_done) frames_shown = frames_done;\r
}\r
}\r
+#ifdef PFRAMES\r
+ sprintf(fpsbuff, "%i", Pico.m.frame_count);\r
+#endif\r
\r
lim_time = (frames_done+1) * target_frametime + vsync_offset;\r
if(currentConfig.Frameskip >= 0) { // frameskip enabled\r
}\r
} else {\r
sram_size = SRam.end-SRam.start+1;\r
- if(SRam.reg_back & 4) sram_size=0x2000;\r
+ if(Pico.m.sram_reg & 4) sram_size=0x2000;\r
sram_data = SRam.data;\r
}\r
if (!sram_data) return 0; // SRam forcefully disabled for this game\r