From dcf718bdd96c3bbe27e18200f6384cd43c95c111 Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Sun, 30 Jul 2017 13:57:47 +0300 Subject: * Revert parts of the per game memory card patch. The previous implementation was doing file paths manipulation deep inside sio.c, and it was hardcoding windows style paths. This was breaking on linux in more than one ways and it is incompatible with the dynamic apppath handling from codeplex branch. Moreover, SaveMcd and LoadMcd functions already take memory card file paths as arguments, making any such logic redundant. This patch rewrites the global Config.Mcd# variables during game startup, which makes it more compatible across all platforms. It also has the added benefit that it doesn't update the configuration file with the each game's memory cards, i.e. at PCSXR startup the default memory cards will be loaded. --- libpcsxcore/plugins.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libpcsxcore/plugins.c') diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index 567630c8..c4fdae68 100755 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -25,6 +25,7 @@ #include "cdriso.h" static char IsoFile[MAXPATHLEN] = ""; +static char AppPath[MAXPATHLEN] = ""; //Application path(== pcsxr.exe directory) static s64 cdOpenCaseTime = 0; GPUupdateLace GPU_updateLace; @@ -845,10 +846,23 @@ void SetIsoFile(const char *filename) { strncpy(IsoFile, filename, MAXPATHLEN); } +// Set pcsxr.exe directory. This is not contain filename(and ext)). +void SetAppPath(const char *apppath ) { + if (apppath == NULL) { + AppPath[0] = '\0'; + return; + } + strncpy(AppPath, apppath, MAXPATHLEN); +} + const char *GetIsoFile(void) { return IsoFile; } +const char *GetAppPath(void) { + return AppPath; +} + boolean UsingIso(void) { return (IsoFile[0] != '\0' || Config.Cdr[0] == '\0'); } -- cgit v1.2.3