diff options
| author | Stelios Tsampas <loathingkernel@gmail.com> | 2017-07-30 13:57:47 +0300 |
|---|---|---|
| committer | Stelios Tsampas <loathingkernel@gmail.com> | 2017-07-30 17:18:07 +0300 |
| commit | dcf718bdd96c3bbe27e18200f6384cd43c95c111 (patch) | |
| tree | 140b77d9d9e4dd940d85daf080cdc944f14984dd /libpcsxcore/psxmem.c | |
| parent | b117a70fd03d780b5817c635d5c337c6ecc36d94 (diff) | |
| download | pcsxr-dcf718bdd96c3bbe27e18200f6384cd43c95c111.tar.gz | |
* 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.
Diffstat (limited to 'libpcsxcore/psxmem.c')
| -rwxr-xr-x | libpcsxcore/psxmem.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index bc2a0ca0..ae2600ab 100755 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -107,16 +107,22 @@ int psxMemInit() { void psxMemReset() { FILE *f = NULL; - char bios[1024]; + char bios[1024] = { '\0' }; memset(psxM, 0, 0x00200000); memset(psxP, 0, 0x00010000); // Load BIOS if (strcmp(Config.Bios, "HLE") != 0) { - sprintf(bios, "%s/%s", Config.BiosDir, Config.Bios); - f = fopen(bios, "rb"); + //AppPath's priority is high. + const char* apppath = GetAppPath(); + if( strlen(apppath) > 0 ) + strcat( strcat( strcat( bios, GetAppPath() ), "bios\\"), Config.Bios ); + else + sprintf(bios, "%s/%s", Config.BiosDir, Config.Bios); + + f = fopen(bios, "rb"); if (f == NULL) { SysMessage(_("Could not open BIOS:\"%s\". Enabling HLE Bios!\n"), bios); memset(psxR, 0, 0x80000); @@ -125,6 +131,7 @@ void psxMemReset() { fread(psxR, 1, 0x80000, f); fclose(f); Config.HLE = FALSE; + SysPrintf(_("Loaded BIOS: %s\n"), bios ); } } else Config.HLE = TRUE; } |
