From f3fafab8b327df5012cb048f567f1679033c9d6f Mon Sep 17 00:00:00 2001 From: BearOso Date: Mon, 25 Apr 2022 15:45:39 -0500 Subject: [PATCH] Remove unused logger.cpp and logger.h. --- cpu.cpp | 2 - gtk/CMakeLists.txt | 3 +- gtk/meson.build | 1 - gtk/src/gtk_s9xcore.h | 1 - libretro/Makefile.common | 1 - libretro/libretro-win32.vcxproj | 2 - libretro/libretro-win32.vcxproj.filters | 6 -- libretro/libretro.cpp | 1 - logger.cpp | 98 ------------------------- logger.h | 15 ---- unix/Makefile.in | 2 +- unix/unix.cpp | 1 - unix/x11.cpp | 6 +- win32/snes9xw.vcxproj | 4 +- win32/snes9xw.vcxproj.filters | 6 -- 15 files changed, 4 insertions(+), 145 deletions(-) delete mode 100644 logger.cpp delete mode 100644 logger.h diff --git a/cpu.cpp b/cpu.cpp index f77f1490..4187496f 100644 --- a/cpu.cpp +++ b/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/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index 0bed2996..a2de6bba 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -255,7 +255,6 @@ list(APPEND SOURCES ../stream.cpp ../conffile.cpp ../bsx.cpp - ../logger.cpp ../snapshot.cpp ../screenshot.cpp ../movie.cpp @@ -321,4 +320,4 @@ install(FILES data/snes9x_32x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ico install(FILES data/snes9x_64x64.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps RENAME snes9x.png) install(FILES data/snes9x_128x128.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps RENAME snes9x.png) install(FILES data/snes9x_256x256.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps RENAME snes9x.png) -install(FILES data/snes9x.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) \ No newline at end of file +install(FILES data/snes9x.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) diff --git a/gtk/meson.build b/gtk/meson.build index fb36a943..b6842aba 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -313,7 +313,6 @@ srcs += [ '../stream.cpp', '../conffile.cpp', '../bsx.cpp', - '../logger.cpp', '../snapshot.cpp', '../screenshot.cpp', '../movie.cpp', diff --git a/gtk/src/gtk_s9xcore.h b/gtk/src/gtk_s9xcore.h index 2f36ad31..07fd95e2 100644 --- a/gtk/src/gtk_s9xcore.h +++ b/gtk/src/gtk_s9xcore.h @@ -18,7 +18,6 @@ #include "gfx.h" #include "spc7110.h" #include "controls.h" -#include "logger.h" #include "cheats.h" #include "movie.h" #include "conffile.h" diff --git a/libretro/Makefile.common b/libretro/Makefile.common index af800249..a751357c 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -35,7 +35,6 @@ SOURCES_CXX := $(CORE_DIR)/apu/apu.cpp \ $(CORE_DIR)/fxemu.cpp \ $(CORE_DIR)/gfx.cpp \ $(CORE_DIR)/globals.cpp \ - $(CORE_DIR)/logger.cpp \ $(CORE_DIR)/memmap.cpp \ $(CORE_DIR)/obc1.cpp \ $(CORE_DIR)/msu1.cpp \ diff --git a/libretro/libretro-win32.vcxproj b/libretro/libretro-win32.vcxproj index 5c9142db..eb466508 100644 --- a/libretro/libretro-win32.vcxproj +++ b/libretro/libretro-win32.vcxproj @@ -221,7 +221,6 @@ - @@ -285,7 +284,6 @@ - diff --git a/libretro/libretro-win32.vcxproj.filters b/libretro/libretro-win32.vcxproj.filters index b995249b..d8e66503 100644 --- a/libretro/libretro-win32.vcxproj.filters +++ b/libretro/libretro-win32.vcxproj.filters @@ -81,9 +81,6 @@ s9x-source - - s9x-source - s9x-source @@ -266,9 +263,6 @@ s9x-source - - s9x-source - s9x-source diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index e10b555d..482d4f3c 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -11,7 +11,6 @@ #include "controls.h" #include "cheats.h" #include "movie.h" -#include "logger.h" #include "display.h" #include "conffile.h" #include "crosshairs.h" diff --git a/logger.cpp b/logger.cpp deleted file mode 100644 index 5db39a60..00000000 --- a/logger.cpp +++ /dev/null @@ -1,98 +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. -\*****************************************************************************/ - -#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"); - } -} diff --git a/logger.h b/logger.h deleted file mode 100644 index 2a37dc26..00000000 --- a/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 diff --git a/unix/Makefile.in b/unix/Makefile.in index 852fd39e..094dce76 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -8,7 +8,7 @@ OS = `uname -s -r -m|sed \"s/ /-/g\"|tr \"[A-Z]\" \"[a-z]\"|tr \"/()\" \"___\"` BUILDDIR = . -OBJECTS = ../apu/apu.o ../apu/bapu/dsp/sdsp.o ../apu/bapu/smp/smp.o ../apu/bapu/smp/smp_state.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../msu1.o ../movie.o ../obc1.o ../ppu.o ../stream.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../tileimpl-n1x1.o ../tileimpl-n2x1.o ../tileimpl-h2x1.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o ../statemanager.o ../sha256.o ../bml.o ../compat.o unix.o x11.o +OBJECTS = ../apu/apu.o ../apu/bapu/dsp/sdsp.o ../apu/bapu/smp/smp.o ../apu/bapu/smp/smp_state.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../memmap.o ../msu1.o ../movie.o ../obc1.o ../ppu.o ../stream.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../tileimpl-n1x1.o ../tileimpl-n2x1.o ../tileimpl-h2x1.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o ../statemanager.o ../sha256.o ../bml.o ../compat.o unix.o x11.o DEFS = -DMITSHM ifdef S9XDEBUGGER diff --git a/unix/unix.cpp b/unix/unix.cpp index 0ea39c6a..c6884a16 100644 --- a/unix/unix.cpp +++ b/unix/unix.cpp @@ -49,7 +49,6 @@ #include "controls.h" #include "cheats.h" #include "movie.h" -#include "logger.h" #include "display.h" #include "conffile.h" #ifdef NETPLAY_SUPPORT diff --git a/unix/x11.cpp b/unix/x11.cpp index 5f976d72..99a390e1 100644 --- a/unix/x11.cpp +++ b/unix/x11.cpp @@ -48,7 +48,6 @@ #include "ppu.h" #include "controls.h" #include "movie.h" -#include "logger.h" #include "conffile.h" #include "blit.h" #include "display.h" @@ -1546,9 +1545,6 @@ static void Repaint (bool8 isFrameBoundry) XDefineCursor(GUI.display, GUI.window, GUI.point_cursor); } } - - if (Settings.DumpStreams && isFrameBoundry) - S9xVideoLogger(GUI.image->data, SNES_WIDTH * 2, SNES_HEIGHT_EXTENDED * 2, GUI.bytes_per_pixel, GUI.image->bytes_per_line); } void S9xTextMode (void) @@ -1856,4 +1852,4 @@ bool S9xDisplayPollPointer (uint32 id, int16 *x, int16 *y) *y = GUI.mouse_y; return (true); -} \ No newline at end of file +} diff --git a/win32/snes9xw.vcxproj b/win32/snes9xw.vcxproj index d6690cbb..4b935d16 100644 --- a/win32/snes9xw.vcxproj +++ b/win32/snes9xw.vcxproj @@ -369,7 +369,6 @@ - @@ -516,7 +515,6 @@ - @@ -749,4 +747,4 @@ - \ No newline at end of file + diff --git a/win32/snes9xw.vcxproj.filters b/win32/snes9xw.vcxproj.filters index 3af130e2..d4d3947b 100644 --- a/win32/snes9xw.vcxproj.filters +++ b/win32/snes9xw.vcxproj.filters @@ -365,9 +365,6 @@ Emu - - Emu - Emu @@ -758,9 +755,6 @@ Emu - - Emu - Emu