aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2013-01-28 20:14:54 +0200
committernotaz2013-01-28 20:14:54 +0200
commit6f18d16a0abcbc0655ed82fd30796fa06242c2b8 (patch)
tree8750cab07734b2c0edcba82d56da77632b558d8d
parentb0dd9956467322aca812db75b5e0f11f23c1910b (diff)
downloadpcsx_rearmed-6f18d16a0abcbc0655ed82fd30796fa06242c2b8.tar.gz
pcsx_rearmed-6f18d16a0abcbc0655ed82fd30796fa06242c2b8.tar.bz2
pcsx_rearmed-6f18d16a0abcbc0655ed82fd30796fa06242c2b8.zip
ange how no memcards are specified
empty string now just means "don't save/load"
-rw-r--r--frontend/menu.c4
-rw-r--r--libpcsxcore/sio.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/frontend/menu.c b/frontend/menu.c
index 9ca5f95..8119505 100644
--- a/frontend/menu.c
+++ b/frontend/menu.c
@@ -1700,10 +1700,10 @@ out:
static void handle_memcard_sel(void)
{
- Config.Mcd1[0] = 0;
+ strcpy(Config.Mcd1, "none");
if (memcard1_sel != 0)
snprintf(Config.Mcd1, sizeof(Config.Mcd1), ".%s%s", MEMCARD_DIR, memcards[memcard1_sel]);
- Config.Mcd2[0] = 0;
+ strcpy(Config.Mcd2, "none");
if (memcard2_sel != 0)
snprintf(Config.Mcd2, sizeof(Config.Mcd2), ".%s%s", MEMCARD_DIR, memcards[memcard2_sel]);
LoadMcds(Config.Mcd1, Config.Mcd2);
diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c
index ea96e95..b3732d2 100644
--- a/libpcsxcore/sio.c
+++ b/libpcsxcore/sio.c
@@ -409,10 +409,13 @@ void LoadMcd(int mcd, char *str) {
}
McdDisable[mcd - 1] = 0;
- if (str == NULL || *str == 0) {
+ if (str == NULL || strcmp(str, "none") == 0) {
McdDisable[mcd - 1] = 1;
return;
}
+ if (*str == 0)
+ return;
+
f = fopen(str, "rb");
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
@@ -455,6 +458,9 @@ void LoadMcds(char *mcd1, char *mcd2) {
void SaveMcd(char *mcd, char *data, uint32_t adr, int size) {
FILE *f;
+ if (mcd == NULL || *mcd == 0 || strcmp(mcd, "none") == 0)
+ return;
+
f = fopen(mcd, "r+b");
if (f != NULL) {
struct stat buf;