Snes9x - Remove unused logger.cpp and logger.h. (#1000)

This commit is contained in:
bladeoner 2022-04-30 20:24:18 +02:00 committed by GitHub
parent 20ace6b0ed
commit b643b0d7ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 124 deletions

View File

@ -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);

View File

@ -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

View File

@ -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