--- snes9x/unix/x11.cpp 10 Jul 2004 20:01:23 -0000 +++ snes9x/unix/x11.cpp 27 Jul 2004 07:48:43 -0000 @@ -1,3 +1,5 @@ +#define NESVIDEOS_LOGGING 1 + /******************************************************************************* Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. @@ -1808,8 +1810,35 @@ } } +#if NESVIDEOS_LOGGING +#include "soundux.h" +#endif + 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 +2879,15 @@ } #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) --- snes9x/unix/unix.cpp 10 Jul 2004 20:01:23 -0000 +++ snes9x/unix/unix.cpp 27 Jul 2004 07:48:45 -0000 @@ -1,3 +1,5 @@ +#define NESVIDEOS_LOGGING 1 + /******************************************************************************* Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. @@ -1285,6 +1287,11 @@ ++IPPU.SkippedFrames; IPPU.RenderThisFrame = FALSE; } +#if NESVIDEOS_LOGGING + IPPU.RenderThisFrame = TRUE; + IPPU.SkippedFrames = 0; + IPPU.FrameSkip = 0; +#endif return; } @@ -1948,6 +1955,11 @@ { #endif +#if NESVIDEOS_LOGGING + usleep(1); + continue; +#endif + /* Number of samples to generate now */ int sample_count = so.buffer_size;