Merge pull request #3 from Alcaro/master
Fix pointless file dropped into $PWD. Hook up output to the log interface.
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
#include "../../fceu.h"
|
#include "../../fceu.h"
|
||||||
#include "../../fceu-endian.h"
|
#include "../../fceu-endian.h"
|
||||||
#include "../../input.h"
|
#include "../../input.h"
|
||||||
#include "../..//state.h"
|
#include "../../state.h"
|
||||||
#include "../../ppu.h"
|
#include "../../ppu.h"
|
||||||
#include "../../cart.h"
|
#include "../../cart.h"
|
||||||
#include "../../x6502.h"
|
#include "../../x6502.h"
|
||||||
@@ -126,11 +126,19 @@ bool FCEUD_ShouldDrawInputAids (void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct retro_log_callback log;
|
||||||
|
|
||||||
|
static void default_logger(enum retro_log_level level, const char *fmt, ...) {}
|
||||||
|
|
||||||
void FCEUD_PrintError(char *c)
|
void FCEUD_PrintError(char *c)
|
||||||
{ }
|
{
|
||||||
|
log.log(RETRO_LOG_WARNING, "%s", c);
|
||||||
|
}
|
||||||
|
|
||||||
void FCEUD_Message(char *s)
|
void FCEUD_Message(char *s)
|
||||||
{ }
|
{
|
||||||
|
log.log(RETRO_LOG_INFO, "%s", s);
|
||||||
|
}
|
||||||
|
|
||||||
void FCEUD_NetworkClose(void)
|
void FCEUD_NetworkClose(void)
|
||||||
{ }
|
{ }
|
||||||
@@ -468,10 +476,12 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
|
|||||||
|
|
||||||
void retro_init(void)
|
void retro_init(void)
|
||||||
{
|
{
|
||||||
|
log.log=default_logger;
|
||||||
|
environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log);
|
||||||
#ifdef FRONTEND_SUPPORTS_RGB565
|
#ifdef FRONTEND_SUPPORTS_RGB565
|
||||||
enum retro_pixel_format rgb565 = RETRO_PIXEL_FORMAT_RGB565;
|
enum retro_pixel_format rgb565 = RETRO_PIXEL_FORMAT_RGB565;
|
||||||
if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb565))
|
if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb565))
|
||||||
fprintf(stderr, "Frontend supports RGB565 - will use that instead of XRGB1555.\n");
|
log.log(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n");
|
||||||
#endif
|
#endif
|
||||||
PowerNES();
|
PowerNES();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -460,9 +460,11 @@ void FCEU_printf(char *format, ...) {
|
|||||||
vsprintf(temp, format, ap);
|
vsprintf(temp, format, ap);
|
||||||
FCEUD_Message(temp);
|
FCEUD_Message(temp);
|
||||||
|
|
||||||
|
#ifndef __LIBRETRO__
|
||||||
ofile = fopen("stdout.txt", "ab");
|
ofile = fopen("stdout.txt", "ab");
|
||||||
fwrite(temp, 1, strlen(temp), ofile);
|
fwrite(temp, 1, strlen(temp), ofile);
|
||||||
fclose(ofile);
|
fclose(ofile);
|
||||||
|
#endif
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user