diff --git a/source/snes9x/cpu.cpp b/source/snes9x/cpu.cpp index f77f149..4187496 100644 --- a/source/snes9x/cpu.cpp +++ b/source/snes9x/cpu.cpp @@ -13,7 +13,6 @@ #include "srtc.h" #include "snapshot.h" #include "cheats.h" -#include "logger.h" #ifdef DEBUGGER #include "debug.h" #endif @@ -99,7 +98,6 @@ static void S9xSoftResetCPU (void) void S9xReset (void) { S9xResetSaveTimer(FALSE); - S9xResetLogger(); memset(Memory.RAM, 0x55, 0x20000); memset(Memory.VRAM, 0x00, 0x10000); diff --git a/source/snes9x/logger.cpp b/source/snes9x/logger.cpp deleted file mode 100644 index 1a8eed8..0000000 --- a/source/snes9x/logger.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -#ifdef GEKKO -void S9xResetLogger (void) { } -void S9xCloseLogger (void) { } -void S9xVideoLogger (void *pixels, int width, int height, int depth, int bytes_per_line) { } -void S9xAudioLogger (void *samples, int length) { } -#else - -#include "snes9x.h" -#include "movie.h" -#include "logger.h" - -static int resetno = 0; -static int framecounter = 0; -static FILE *video = NULL; -static FILE *audio = NULL; - - -void S9xResetLogger (void) -{ - if (!Settings.DumpStreams) - return; - - char buffer[128]; - - S9xCloseLogger(); - framecounter = 0; - - sprintf(buffer, "videostream%d.dat", resetno); - video = fopen(buffer, "wb"); - if (!video) - { - printf("Opening %s failed. Logging cancelled.\n", buffer); - return; - } - - sprintf(buffer, "audiostream%d.dat", resetno); - audio = fopen(buffer, "wb"); - if (!audio) - { - printf("Opening %s failed. Logging cancelled.\n", buffer); - fclose(video); - return; - } - - resetno++; -} - -void S9xCloseLogger (void) -{ - if (video) - { - fclose(video); - video = NULL; - } - - if (audio) - { - fclose(audio); - audio = NULL; - } -} - -void S9xVideoLogger (void *pixels, int width, int height, int depth, int bytes_per_line) -{ - int fc = S9xMovieGetFrameCounter(); - if (fc > 0) - framecounter = fc; - else - framecounter++; - - if (video) - { - char *data = (char *) pixels; - - for (int i = 0; i < height; i++) - { - if (!fwrite(data + i * bytes_per_line, depth, width, video)) - printf ("Error writing video data.\n"); - } - fflush(video); - fflush(audio); - - if (Settings.DumpStreamsMaxFrames > 0 && framecounter >= Settings.DumpStreamsMaxFrames) - { - printf("Logging ended.\n"); - S9xCloseLogger(); - } - - } -} - -void S9xAudioLogger (void *samples, int length) -{ - if (audio) - { - if (!fwrite(samples, 1, length, audio)) - printf ("Error writing audio data.\n"); - } -} - -#endif diff --git a/source/snes9x/logger.h b/source/snes9x/logger.h deleted file mode 100644 index 2a37dc2..0000000 --- a/source/snes9x/logger.h +++ /dev/null @@ -1,15 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -#ifndef _LOGGER_H_ -#define _LOGGER_H_ - -void S9xResetLogger(void); -void S9xCloseLogger(void); -void S9xVideoLogger(void *, int, int, int, int); -void S9xAudioLogger(void *, int); - -#endif