mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +00:00
Add some file logging stuff for Wii debugging
This commit is contained in:
parent
96c20550b5
commit
1193d41360
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
DEBUG = 0
|
DEBUG = 0
|
||||||
HAVE_LOGGER = 0
|
HAVE_LOGGER = 0
|
||||||
|
HAVE_FILE_LOGGER = 0
|
||||||
|
|
||||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||||
@ -32,6 +33,10 @@ CFLAGS += -DHAVE_LOGGER
|
|||||||
OBJ += console/logger/logger.o
|
OBJ += console/logger/logger.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||||
|
CFLAGS += -DHAVE_FILE_LOGGER
|
||||||
|
endif
|
||||||
|
|
||||||
CFLAGS += -std=gnu99 -DSSNES_CONSOLE -DHAVE_CONFIGFILE=1 -DGEKKO -DHW_RVL -DHAVE_ZLIB -DHAVE_GETOPT_LONG -DHAVE_FREETYPE -DPACKAGE_VERSION=\"0.9.5\" -Dmain=ssnes_main -Wno-char-subscripts -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
CFLAGS += -std=gnu99 -DSSNES_CONSOLE -DHAVE_CONFIGFILE=1 -DGEKKO -DHW_RVL -DHAVE_ZLIB -DHAVE_GETOPT_LONG -DHAVE_FREETYPE -DPACKAGE_VERSION=\"0.9.5\" -Dmain=ssnes_main -Wno-char-subscripts -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
|
@ -467,7 +467,7 @@ extern struct console_settings g_console;
|
|||||||
#endif
|
#endif
|
||||||
/////////
|
/////////
|
||||||
|
|
||||||
#if defined(SSNES_CONSOLE) && defined(HAVE_LOGGER)
|
#if defined(SSNES_CONSOLE) && (defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER))
|
||||||
#include "logger_override.h"
|
#include "logger_override.h"
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
#ifndef __SSNES_LOGGER_OVERRIDE_H
|
#ifndef __SSNES_LOGGER_OVERRIDE_H
|
||||||
#define __SSNES_LOGGER_OVERRIDE_H
|
#define __SSNES_LOGGER_OVERRIDE_H
|
||||||
|
|
||||||
#if (defined(__CELLOS_LV2__) || defined(HW_RVL)) && defined(HAVE_LOGGER)
|
#if defined(HAVE_LOGGER)
|
||||||
|
|
||||||
#include "console/logger/logger.h"
|
#include "console/logger/logger.h"
|
||||||
|
|
||||||
#define SSNES_LOG(...) do { \
|
#define SSNES_LOG(...) do { \
|
||||||
@ -32,6 +31,29 @@
|
|||||||
#define SSNES_WARN(...) do { \
|
#define SSNES_WARN(...) do { \
|
||||||
logger_send("SSNES [WARN] :: " __VA_ARGS__); \
|
logger_send("SSNES [WARN] :: " __VA_ARGS__); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
#elif defined(HAVE_FILE_LOGGER)
|
||||||
|
extern FILE * log_fp;
|
||||||
|
#ifndef SSNES_LOG
|
||||||
|
#define SSNES_LOG(...) do { \
|
||||||
|
if (g_extern.verbose) \
|
||||||
|
fprintf(log_fp, "SSNES: " __VA_ARGS__); \
|
||||||
|
fflush(log_fp); \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SSNES_ERR
|
||||||
|
#define SSNES_ERR(...) do { \
|
||||||
|
fprintf(log_fp, "SSNES [ERROR] :: " __VA_ARGS__); \
|
||||||
|
fflush(log_fp); \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SSNES_WARN
|
||||||
|
#define SSNES_WARN(...) do { \
|
||||||
|
fprintf(log_fp, "SSNES [WARN] :: " __VA_ARGS__); \
|
||||||
|
fflush(log_fp); \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
12
wii/main.c
12
wii/main.c
@ -35,6 +35,10 @@
|
|||||||
#include <sdcard/gcsd.h>
|
#include <sdcard/gcsd.h>
|
||||||
#include <fat.h>
|
#include <fat.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_FILE_LOGGER
|
||||||
|
FILE * log_fp;
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint16_t menu_framebuf[SGUI_WIDTH * SGUI_HEIGHT];
|
static uint16_t menu_framebuf[SGUI_WIDTH * SGUI_HEIGHT];
|
||||||
|
|
||||||
static bool folder_cb(const char *directory, sgui_file_enum_cb_t file_cb,
|
static bool folder_cb(const char *directory, sgui_file_enum_cb_t file_cb,
|
||||||
@ -126,6 +130,10 @@ int main(void)
|
|||||||
{
|
{
|
||||||
fatInitDefault();
|
fatInitDefault();
|
||||||
|
|
||||||
|
#ifdef HAVE_FILE_LOGGER
|
||||||
|
log_fp = fopen("sd:/ssnes-log.txt", "w");
|
||||||
|
#endif
|
||||||
|
|
||||||
wii_video_init();
|
wii_video_init();
|
||||||
wii_input_init();
|
wii_input_init();
|
||||||
|
|
||||||
@ -146,6 +154,10 @@ int main(void)
|
|||||||
wii_input_deinit();
|
wii_input_deinit();
|
||||||
wii_video_deinit();
|
wii_video_deinit();
|
||||||
|
|
||||||
|
#ifdef HAVE_FILE_LOGGER
|
||||||
|
fclose(log_fp);
|
||||||
|
#endif
|
||||||
|
|
||||||
sgui_free(sgui);
|
sgui_free(sgui);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user