diff --git a/src/disc.c b/src/disc.c index e858474ce..ad7459fe2 100644 --- a/src/disc.c +++ b/src/disc.c @@ -127,7 +127,7 @@ void disc_load(int drive, wchar_t *fn) } c++; } - pclog("Couldn't load %s %s\n",fn,p); + pclog_w(L"Couldn't load %s %s\n",fn,p); drive_empty[drive] = 1; fdd_set_head(real_drive(drive), 0); discfns[drive][0] = L'\0'; diff --git a/src/ibm.h b/src/ibm.h index 5898a8b2d..c163e5f15 100644 --- a/src/ibm.h +++ b/src/ibm.h @@ -664,6 +664,7 @@ extern uint32_t SCSIGetCDChannel(int channel); extern int ui_writeprot[4]; void pclog(const char *format, ...); +void pclog_w(const wchar_t *format, ...); extern int nmi; extern int nmi_auto_clear; diff --git a/src/pc.c b/src/pc.c index 4f49e367d..abfb59c38 100644 --- a/src/pc.c +++ b/src/pc.c @@ -115,6 +115,17 @@ void pclog(const char *format, ...) #endif } +void pclog_w(const wchar_t *format, ...) +{ +#ifndef RELEASE_BUILD + va_list ap; + va_start(ap, format); + _vwprintf_p(format, ap); + va_end(ap); + fflush(stdout); +#endif +} + #ifndef __unix #ifndef _LIBC # define __builtin_expect(expr, val) (expr) @@ -705,7 +716,7 @@ void loadconfig(wchar_t *fn) int c, d; char s[512]; char *p; - WCHAR *wp, *wq; + wchar_t *wp, *wq; char temps[512]; if (!fn) @@ -920,9 +931,9 @@ void loadconfig(wchar_t *fn) } memset(nvr_path, 0, 2048); - wp = (char *)config_get_wstring(NULL, "nvr_path", "nvr"); + wp = (wchar_t *)config_get_wstring(NULL, "nvr_path", L"nvr"); if (wp) { - if (strlen(wp) <= 992) wcscpy(nvr_path, wp); + if (wcslen(wp) <= 992) wcscpy(nvr_path, wp); else { append_filename_w(nvr_path, pcempath, L"nvr", 511);