From 130984f52889f26121d54d7b1feecc15700a0f7a Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Fri, 2 Aug 2019 18:51:32 +0800 Subject: [PATCH] Use retro_log for SysPrintf --- frontend/libretro.c | 12 ++++++++++++ frontend/main.c | 2 ++ 2 files changed, 14 insertions(+) diff --git a/frontend/libretro.c b/frontend/libretro.c index e48069a9..b8d17ab9 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -2286,3 +2286,15 @@ int usleep (unsigned long us) sceKernelDelayThread(us); } #endif + +void SysPrintf(const char *fmt, ...) { + va_list list; + char msg[512]; + + va_start(list, fmt); + vsprintf(msg, fmt, list); + va_end(list); + + if (log_cb) + log_cb(RETRO_LOG_INFO, "%s", msg); +} diff --git a/frontend/main.c b/frontend/main.c index 860dec0d..c0bfd0fd 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -795,6 +795,7 @@ int emu_load_state(int slot) return LoadState(fname); } +#ifndef HAVE_LIBRETRO #ifndef ANDROID void SysPrintf(const char *fmt, ...) { @@ -819,6 +820,7 @@ void SysPrintf(const char *fmt, ...) { } #endif +#endif /* HAVE_LIBRETRO */ void SysMessage(const char *fmt, ...) { va_list list; -- 2.39.5