diff --git a/src/nvr.c b/src/nvr.c index 692e0e66b..39e2fd7fb 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -679,7 +679,7 @@ nvr_load(void) /* We are responsible for loading. */ f = NULL; if (saved_nvr->mask != 0) { - pclog("Opening NVR file: %ls...\n", saved_nvr->fname); + pclog("Opening NVR file: %ls...\n", nvr_path(saved_nvr->fname)); f = plat_fopen(nvr_path(saved_nvr->fname), L"rb"); } @@ -722,7 +722,7 @@ nvr_save(void) /* We are responsible for saving. */ f = NULL; if (saved_nvr->mask != 0) { - pclog("Saving NVR file: %ls...\n", saved_nvr->fname); + pclog("Saving NVR file: %ls...\n", nvr_path(saved_nvr->fname)); f = plat_fopen(nvr_path(saved_nvr->fname), L"wb"); } diff --git a/src/nvr_at.c b/src/nvr_at.c index 4db6b1595..259e67a40 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -31,6 +31,7 @@ #include "io.h" #include "device.h" #include "machine/machine.h" +#include "nmi.h" #include "nvr.h" @@ -44,9 +45,7 @@ nvr_write(uint16_t addr, uint8_t val, void *priv) if (! (addr & 1)) { nvr->addr = (val & nvr->mask); -#if 0 - nvr->nmi_mask = (~val & 0x80); -#endif + nmi_mask = (~val & 0x80); return; } diff --git a/src/pc.c b/src/pc.c index 932db118c..533a499b5 100644 --- a/src/pc.c +++ b/src/pc.c @@ -337,6 +337,20 @@ get_actual_size_y(void) } +void cfg_path_slash(void) +{ + /* Make sure cfg_path has a trailing backslash. */ + if ((cfg_path[wcslen(cfg_path)-1] != L'\\') && + (cfg_path[wcslen(cfg_path)-1] != L'/')) { +#ifdef _WIN32 + wcscat(cfg_path, L"\\"); +#else + wcscat(cfg_path, L"/"); +#endif + } +} + + /* * Perform initial startup of the PC. * @@ -352,6 +366,8 @@ pc_init(int argc, wchar_t *argv[]) struct tm *info; time_t now; int c; + int cfgp = 0; + wchar_t cmdl_cfg_path[2048]; /* Grab the executable's full path. */ plat_get_exe_name(exe_path, sizeof(exe_path)-1); @@ -410,7 +426,8 @@ usage: !wcscasecmp(argv[c], L"-P")) { if ((c+1) == argc) goto usage; - wcscpy(cfg_path, argv[++c]); + wcscpy(cmdl_cfg_path, argv[++c]); + cfgp = 1; #ifdef USE_WX } else if (!wcscasecmp(argv[c], L"--fps") || !wcscasecmp(argv[c], L"-R")) { @@ -434,16 +451,20 @@ usage: cfg = argv[c++]; if (c != argc) goto usage; - /* Make sure cfg_path has a trailing backslash. */ - if ((cfg_path[wcslen(cfg_path)-1] != L'\\') && - (cfg_path[wcslen(cfg_path)-1] != L'/')) { -#ifdef _WIN32 - wcscat(cfg_path, L"\\"); -#else - wcscat(cfg_path, L"/"); -#endif + if (!cfgp) { + wcscpy(cfg_path, exe_path); + } else { + if ((cmdl_cfg_path[0] != L'\\') && (cmdl_cfg_path[0] != L'/') && (cmdl_cfg_path[1] != L':')) { + wcscpy(cfg_path, exe_path); + cfg_path_slash(); + wcscat(cfg_path, cmdl_cfg_path); + } else { + wcscpy(cfg_path, cmdl_cfg_path); + } } + cfg_path_slash(); + if (cfg != NULL) { /* * The user specified a configuration file. diff --git a/src/win/win_video.c b/src/win/win_video.c index 57b8b443a..3c7542f35 100644 --- a/src/win/win_video.c +++ b/src/win/win_video.c @@ -306,7 +306,7 @@ take_screenshot(void) break; #else case 0: /* ddraw */ - wcsftime(path, 128, L"%Y%m%d_%H%M%S.bmp", info); + wcsftime(fn, 128, L"%Y%m%d_%H%M%S.bmp", info); wcscat(path, fn); ddraw_take_screenshot(path); break;