diff --git a/Makefile.libretro b/Makefile.libretro index 8de2e00..6ad50e6 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -1,5 +1,6 @@ NTSC = 0 DEBUG = 0 +LOGSOUND = 0 GENPLUS_SRC_DIR := source LIBRETRO_DIR := libretro @@ -124,6 +125,10 @@ LIBRETRO_SRC := $(GENPLUS_SRC_DIR)/genesis.c \ LIBRETRO_OBJ := $(LIBRETRO_SRC:.c=.o) +ifeq ($(LOGSOUND), 1) +LIBRETRO_CFLAGS := -DLOGSOUND +endif + ifeq ($(platform), sncps3) CODE_DEFINES = else @@ -133,7 +138,7 @@ endif DEFINES := CFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES) -LIBRETRO_CFLAGS := -I$(GENPLUS_SRC_DIR) \ +LIBRETRO_CFLAGS += -I$(GENPLUS_SRC_DIR) \ -I$(GENPLUS_SRC_DIR)/sound \ -I$(GENPLUS_SRC_DIR)/input_hw \ -I$(GENPLUS_SRC_DIR)/cart_hw \ diff --git a/libretro/libretro.c b/libretro/libretro.c index a251c30..38cc607 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -2,6 +2,7 @@ #include #endif #include +#include #include #ifdef _MSC_VER @@ -96,6 +97,22 @@ static uint8_t brm_format[0x40] = ************************************/ #define CHUNKSIZE (0x10000) +void error(char * msg, ...) +{ +#ifdef _XBOX1 + char buffer[1024]; +#endif + va_list ap; + va_start(ap, msg); +#ifdef _XBOX1 + vsnprintf(buffer, sizeof(buffer), msg, ap); + OutputDebugStringA(buffer); +#else + vfprintf(stderr, msg, ap); +#endif + va_end(ap); +} + int load_archive(char *filename, unsigned char *buffer, int maxsize) { int size = 0;