diff --git a/CHANGES b/CHANGES index bed1296f9..131e37e75 100644 --- a/CHANGES +++ b/CHANGES @@ -37,6 +37,7 @@ Misc: - Windows: Add native VDir support - All: Add QUIET parameter to silence CMake - GBA Video: Null renderer should return proper register values + - Libretro: Disable logging game errors, BIOS calls and stubs in release builds 0.4.0: (2016-02-02) Features: diff --git a/src/platform/libretro/libretro.c b/src/platform/libretro/libretro.c index 688482271..34d0b03d1 100644 --- a/src/platform/libretro/libretro.c +++ b/src/platform/libretro/libretro.c @@ -14,6 +14,8 @@ #include "gb/gb.h" #endif #ifdef M_CORE_GBA +#include "gba/bios.h" +#include "gba/core.h" #include "gba/cheats.h" #include "gba/core.h" #include "gba/serialize.h" @@ -478,14 +480,25 @@ void GBARetroLog(struct mLogger* logger, int category, enum mLogLevel level, con retroLevel = RETRO_LOG_WARN; break; case mLOG_INFO: - case mLOG_GAME_ERROR: retroLevel = RETRO_LOG_INFO; break; - case mLOG_DEBUG: + case mLOG_GAME_ERROR: case mLOG_STUB: +#ifdef NDEBUG + return; +#else + retroLevel = RETRO_LOG_DEBUG; + break; +#endif + case mLOG_DEBUG: retroLevel = RETRO_LOG_DEBUG; break; } +#ifdef NDEBUG + if (category == _mLOG_CAT_GBA_BIOS()) { + return; + } +#endif logCallback(retroLevel, "%s: %s\n", mLogCategoryName(category), message); }