Fixed the setting of nvr_path, NVR's with CMOS settings now get saved again;

Added pclog_w which is the Unicode version of pclog, used in disc.c for logging when a floppy image could not be loaded.
This commit is contained in:
OBattler
2017-05-06 14:15:16 +02:00
parent c403855a94
commit e2a717deae
3 changed files with 16 additions and 4 deletions

View File

@@ -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';

View File

@@ -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;

View File

@@ -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);