diff options
author | notaz | 2013-01-28 05:06:43 +0200 |
---|---|---|
committer | notaz | 2013-01-28 05:06:43 +0200 |
commit | 45b97ede8128bd0217943e6b4b88a08a3c1a7003 (patch) | |
tree | 9a83d98d6fdda11a11f4dfbd9f5ed5dfb77f965a /frontend | |
parent | 1ae8c5a80945e4e8d549e0bd763ad1fd132e888e (diff) | |
download | pcsx_rearmed-45b97ede8128bd0217943e6b4b88a08a3c1a7003.tar.gz pcsx_rearmed-45b97ede8128bd0217943e6b4b88a08a3c1a7003.tar.bz2 pcsx_rearmed-45b97ede8128bd0217943e6b4b88a08a3c1a7003.zip |
frontend: logging updates
go to logcat on Android
Diffstat (limited to 'frontend')
m--------- | frontend/libpicofe | 0 | ||||
-rw-r--r-- | frontend/main.c | 36 |
2 files changed, 28 insertions, 8 deletions
diff --git a/frontend/libpicofe b/frontend/libpicofe -Subproject 4db02226eb3c80f49f5c412f7718c437c5e817f +Subproject 215e7ed2510e191664b611a578ffb987cf4fdab diff --git a/frontend/main.c b/frontend/main.c index 43a1a03..8b35b09 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -454,6 +454,8 @@ int emu_core_preinit(void) int emu_core_init(void) { + SysPrintf("Starting PCSX-ReARMed " REV "\n"); + CheckSubDir(); check_memcards(); @@ -553,7 +555,8 @@ int main(int argc, char *argv[]) plat_init(); menu_init(); // loads config - emu_core_init(); + if (emu_core_init() != 0) + return 1; if (psxout) Config.PsxOut = 1; @@ -761,6 +764,8 @@ int emu_load_state(int slot) return LoadState(fname); } +#ifndef ANDROID + void SysPrintf(const char *fmt, ...) { va_list list; @@ -769,16 +774,31 @@ void SysPrintf(const char *fmt, ...) { va_end(list); } +#else + +#include <android/log.h> + +void SysPrintf(const char *fmt, ...) { + va_list list; + + va_start(list, fmt); + __android_log_vprint(ANDROID_LOG_INFO, "PCSX", fmt, list); + va_end(list); +} + +#endif + void SysMessage(const char *fmt, ...) { - va_list list; - char msg[512]; + va_list list; + char msg[512]; + int ret; - va_start(list, fmt); - vsnprintf(msg, sizeof(msg), fmt, list); - va_end(list); + va_start(list, fmt); + ret = vsnprintf(msg, sizeof(msg), fmt, list); + va_end(list); - if (msg[strlen(msg) - 1] == '\n') - msg[strlen(msg) - 1] = 0; + if (ret < sizeof(msg) && msg[ret - 1] == '\n') + msg[ret - 1] = 0; SysPrintf("%s\n", msg); } |