diff -NaHudr snes9x-1.43-dev-src/snes9x/snes9x.h wip1-patched/snes9x/snes9x.h --- snes9x-1.43-dev-src/snes9x/snes9x.h 2004-07-12 00:51:00.000000000 +0300 +++ wip1-patched/snes9x/snes9x.h 2004-10-31 02:11:38.000000000 +0300 @@ -1,3 +1,4 @@ +#define NESVIDEOS_LOGGING 1 /******************************************************************************* Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. diff -NaHudr snes9x-1.43-dev-src/snes9x/unix/unix.cpp wip1-patched/snes9x/unix/unix.cpp --- snes9x-1.43-dev-src/snes9x/unix/unix.cpp 2004-07-12 00:51:03.000000000 +0300 +++ wip1-patched/snes9x/unix/unix.cpp 2004-10-31 02:43:17.000000000 +0300 @@ -1285,6 +1285,11 @@ ++IPPU.SkippedFrames; IPPU.RenderThisFrame = FALSE; } +#if NESVIDEOS_LOGGING + IPPU.RenderThisFrame = TRUE; + IPPU.SkippedFrames = 0; + IPPU.FrameSkip = 0; +#endif return; } @@ -1305,6 +1310,9 @@ /* If there is no known "next" frame, initialize it now */ if (next1.tv_sec == 0) { next1 = now; ++next1.tv_usec; } +#if NESVIDEOS_LOGGING + return; +#endif /* If we're on AUTO_FRAMERATE, we'll display frames always * only if there's excess time. * Otherwise we'll display the defined amount of frames. @@ -1972,6 +1980,11 @@ block_generate_sound = TRUE; +#if NESVIDEOS_LOGGING +# ifdef USE_THREADS + if(Settings.ThreadSound)sleep(1); +# endif +#else /* If we need more audio samples */ if (so.samples_mixed_so_far < sample_count) { @@ -2031,6 +2044,7 @@ } /* All data sent. */ } +#endif so.samples_mixed_so_far -= sample_count; diff -NaHudr snes9x-1.43-dev-src/snes9x/unix/x11.cpp wip1-patched/snes9x/unix/x11.cpp --- snes9x-1.43-dev-src/snes9x/unix/x11.cpp 2004-07-12 00:51:03.000000000 +0300 +++ wip1-patched/snes9x/unix/x11.cpp 2004-10-31 02:14:05.000000000 +0300 @@ -669,7 +669,7 @@ } #ifdef MITSHM - GUI.use_shared_memory = 1; + GUI.use_shared_memory = !NESVIDEOS_LOGGING; int major, minor; Bool shared; @@ -1810,6 +1810,29 @@ void S9xPutImage (int snes_width, int snes_height) { +#if NESVIDEOS_LOGGING + static FILE* out = NULL; + if(!out) out = fopen("s.log", "wb"); + uint8 Buf[262144]; + unsigned N = so.playback_rate * Settings.FrameTime / 1000000; + if(so.stereo) N *= 2; + S9xMixSamplesO(Buf, N, 0); + if(so.sixteen_bit) N *= 2; + if(out) { fwrite(Buf, 1, N, out); fflush(out); } + + if(Settings.TurboMode) + { + fcntl(so.sound_fd, F_SETFL, + fcntl(so.sound_fd, F_GETFL) | O_NONBLOCK); + } + else + { + fcntl(so.sound_fd, F_SETFL, + fcntl(so.sound_fd, F_GETFL) & ~O_NONBLOCK); + } + write(so.sound_fd, Buf, N); +#endif + #ifdef USE_GLIDE if (Settings.GlideEnable) S9xGlidePutImage (snes_width, snes_height); @@ -2850,6 +2873,13 @@ } #endif //XAutoRepeatOff (GUI.display); +#if NESVIDEOS_LOGGING + Settings.InterpolatedSound = 1; + Settings.SkipFrames = 1; + so.sound_switch = 255; + //if(S9xMovieActive()) S9xMovieStop(FALSE); + //S9xMovieOpen(S9xChooseMovieFilename(TRUE), FALSE); +#endif } void S9xParseDisplayArg (char **argv, int &ind, int)