First phase of cleaning up the use of pathnames internally. We now have the --vmpath (short: -P) commandline option to override the 'work dir' relative to which the program will try to find certain files and folders.

This commit is contained in:
waltje
2017-09-23 21:12:26 -04:00
parent 35c25cab74
commit 637ce66da2
25 changed files with 1086 additions and 894 deletions

View File

@@ -3,7 +3,7 @@
*/
#include "../ibm.h"
#include "../mem.h"
#include "../rom.h"
#include "../nvr.h"
#include "vid_ati_eeprom.h"

View File

@@ -8,22 +8,23 @@
*
* Generic SVGA handling.
*
* Version: @(#)vid_svga.c 1.0.0 2017/05/30
* This is intended to be used by another SVGA driver,
* and not as a card in it's own right.
*
* Author: Sarah Walker, <http://pcem-emulator.co.uk/>
* Version: @(#)vid_svga.c 1.0.1 2017/09/19
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
* Copyright 2016,2017 Miran Grca.
*/
/*This is intended to be used by another SVGA driver, and not as a card in it's own right*/
#include <stdio.h>
#include <stdlib.h>
#include "../ibm.h"
#include "../io.h"
#include "../mem.h"
#ifdef ENABLE_VRAM_DUMP
#include "../rom.h"
# include "../nvr.h"
#endif
#include "../timer.h"
#include "video.h"

View File

@@ -718,7 +718,7 @@ BOOL DirectoryExists(LPCTSTR szPath)
(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
}
void take_screenshot()
void take_screenshot(void)
{
if ((vid_api < 0) || (vid_api > 1)) return;
time(&now);
@@ -727,7 +727,7 @@ void take_screenshot()
memset(screenshot_fn_partial, 0, 4096);
memset(screenshot_path, 0, 8192);
pclog("Video API is: %i\n", vid_api);
append_filename_w(screenshot_path, pcempath, L"screenshots", 4095);
append_filename_w(screenshot_path, cfg_path, L"screenshots", 4095);
if (!DirectoryExists(screenshot_path))
{
CreateDirectory(screenshot_path, NULL);
@@ -735,7 +735,7 @@ void take_screenshot()
if (vid_api == 1)
{
wcsftime(screenshot_fn_partial, 2048, L"screenshots\\%Y%m%d_%H%M%S.png", info);
append_filename_w(screenshot_fn, pcempath, screenshot_fn_partial, 4095);
append_filename_w(screenshot_fn, cfg_path, screenshot_fn_partial, 4095);
if (video_fullscreen)
{
d3d_fs_take_screenshot(screenshot_fn);
@@ -749,7 +749,7 @@ void take_screenshot()
else if (vid_api == 0)
{
wcsftime(screenshot_fn_partial, 2048, L"screenshots\\%Y%m%d_%H%M%S.bmp", info);
append_filename_w(screenshot_fn, pcempath, screenshot_fn_partial, 4095);
append_filename_w(screenshot_fn, cfg_path, screenshot_fn_partial, 4095);
if (video_fullscreen)
{
ddraw_fs_take_screenshot(screenshot_fn);