AT NVR writes now again correctly set NMI mask;

If no VM path is specified or the specified VM path is relative, it is now converted to absolute using exe_path;
Fixed saving path for screenshots when using the DirectDraw renderer.
This commit is contained in:
OBattler
2017-11-24 13:14:09 +01:00
parent ce1bab2967
commit 0009d4a1c3
4 changed files with 35 additions and 15 deletions

View File

@@ -679,7 +679,7 @@ nvr_load(void)
/* We are responsible for loading. */ /* We are responsible for loading. */
f = NULL; f = NULL;
if (saved_nvr->mask != 0) { 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"); f = plat_fopen(nvr_path(saved_nvr->fname), L"rb");
} }
@@ -722,7 +722,7 @@ nvr_save(void)
/* We are responsible for saving. */ /* We are responsible for saving. */
f = NULL; f = NULL;
if (saved_nvr->mask != 0) { 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"); f = plat_fopen(nvr_path(saved_nvr->fname), L"wb");
} }

View File

@@ -31,6 +31,7 @@
#include "io.h" #include "io.h"
#include "device.h" #include "device.h"
#include "machine/machine.h" #include "machine/machine.h"
#include "nmi.h"
#include "nvr.h" #include "nvr.h"
@@ -44,9 +45,7 @@ nvr_write(uint16_t addr, uint8_t val, void *priv)
if (! (addr & 1)) { if (! (addr & 1)) {
nvr->addr = (val & nvr->mask); nvr->addr = (val & nvr->mask);
#if 0 nmi_mask = (~val & 0x80);
nvr->nmi_mask = (~val & 0x80);
#endif
return; return;
} }

View File

@@ -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. * Perform initial startup of the PC.
* *
@@ -352,6 +366,8 @@ pc_init(int argc, wchar_t *argv[])
struct tm *info; struct tm *info;
time_t now; time_t now;
int c; int c;
int cfgp = 0;
wchar_t cmdl_cfg_path[2048];
/* Grab the executable's full path. */ /* Grab the executable's full path. */
plat_get_exe_name(exe_path, sizeof(exe_path)-1); plat_get_exe_name(exe_path, sizeof(exe_path)-1);
@@ -410,7 +426,8 @@ usage:
!wcscasecmp(argv[c], L"-P")) { !wcscasecmp(argv[c], L"-P")) {
if ((c+1) == argc) goto usage; if ((c+1) == argc) goto usage;
wcscpy(cfg_path, argv[++c]); wcscpy(cmdl_cfg_path, argv[++c]);
cfgp = 1;
#ifdef USE_WX #ifdef USE_WX
} else if (!wcscasecmp(argv[c], L"--fps") || } else if (!wcscasecmp(argv[c], L"--fps") ||
!wcscasecmp(argv[c], L"-R")) { !wcscasecmp(argv[c], L"-R")) {
@@ -434,16 +451,20 @@ usage:
cfg = argv[c++]; cfg = argv[c++];
if (c != argc) goto usage; if (c != argc) goto usage;
/* Make sure cfg_path has a trailing backslash. */ if (!cfgp) {
if ((cfg_path[wcslen(cfg_path)-1] != L'\\') && wcscpy(cfg_path, exe_path);
(cfg_path[wcslen(cfg_path)-1] != L'/')) { } else {
#ifdef _WIN32 if ((cmdl_cfg_path[0] != L'\\') && (cmdl_cfg_path[0] != L'/') && (cmdl_cfg_path[1] != L':')) {
wcscat(cfg_path, L"\\"); wcscpy(cfg_path, exe_path);
#else cfg_path_slash();
wcscat(cfg_path, L"/"); wcscat(cfg_path, cmdl_cfg_path);
#endif } else {
wcscpy(cfg_path, cmdl_cfg_path);
}
} }
cfg_path_slash();
if (cfg != NULL) { if (cfg != NULL) {
/* /*
* The user specified a configuration file. * The user specified a configuration file.

View File

@@ -306,7 +306,7 @@ take_screenshot(void)
break; break;
#else #else
case 0: /* ddraw */ 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); wcscat(path, fn);
ddraw_take_screenshot(path); ddraw_take_screenshot(path);
break; break;