X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flibretro.c;h=9ce13c5d9249b6f39984c37d1c3c33b01fe53333;hb=c681e48d2b4faa0821138fabf6966683c84d07d6;hp=67b4369cb95fa71fdd449152a46fea34711e5f65;hpb=033a505e6e897779f6ccdfaea7a2b4932521d7ef;p=picodrive.git diff --git a/platform/libretro.c b/platform/libretro.c index 67b4369..9ce13c5 100644 --- a/platform/libretro.c +++ b/platform/libretro.c @@ -263,9 +263,13 @@ void emu_32x_startup(void) void lprintf(const char *fmt, ...) { + char buffer[256]; + va_list ap; + va_start(ap, fmt); + vsprintf(buffer, fmt, ap); /* TODO - add 'level' param for warning/error messages? */ if (log_cb) - log_cb(RETRO_LOG_INFO, fmt); + log_cb(RETRO_LOG_INFO, "%s\n", fmt); } /* libretro */ @@ -870,9 +874,10 @@ void retro_init(void) level = 0; environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level); - environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log); - if (log.log) + if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log)) log_cb = log.log; + else + log_cb = NULL; environ_cb(RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE, &disk_control);