From ac50132052c666af44dde1401ba26fdc7d9a9db6 Mon Sep 17 00:00:00 2001 From: dborth Date: Wed, 23 Dec 2009 07:23:08 +0000 Subject: [PATCH] add more pref file search locations --- source/ngc/fceuconfig.cpp | 20 +++++--------------- source/ngc/preferences.cpp | 15 +++++++++++---- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/source/ngc/fceuconfig.cpp b/source/ngc/fceuconfig.cpp index aafd738..2e29114 100644 --- a/source/ngc/fceuconfig.cpp +++ b/source/ngc/fceuconfig.cpp @@ -63,6 +63,7 @@ void FixInvalidSettings() void DefaultSettings () { + memset (&GCSettings, 0, sizeof (GCSettings)); ResetControls(); // controller button mappings GCSettings.currpal = 1; // color palette @@ -90,21 +91,10 @@ DefaultSettings () GCSettings.Rumble = 1; GCSettings.LoadMethod = DEVICE_AUTO; // Auto, SD, DVD, USB, Network (SMB) - GCSettings.SaveMethod = DEVICE_AUTO; // Auto, SD, Memory Card Slot A, Memory Card Slot B, USB, Network (SMB) - sprintf (GCSettings.LoadFolder,"fceugx/roms"); // Path to game files - sprintf (GCSettings.SaveFolder,"fceugx/saves"); // Path to save files - sprintf (GCSettings.CheatFolder,"fceugx/cheats"); // Path to cheat files + GCSettings.SaveMethod = DEVICE_AUTO; // Auto, SD, USB, Network (SMB) + sprintf (GCSettings.LoadFolder, "%s/roms", APPFOLDER); // Path to game files + sprintf (GCSettings.SaveFolder, "%s/saves", APPFOLDER); // Path to save files + sprintf (GCSettings.CheatFolder, "%s/cheats", APPFOLDER); // Path to cheat files GCSettings.AutoLoad = 1; // Auto Load RAM GCSettings.AutoSave = 1; // Auto Save RAM - - // custom SMB settings - strncpy (GCSettings.smbip, "", 15); // IP Address of share server - strncpy (GCSettings.smbuser, "", 19); // Your share user - strncpy (GCSettings.smbpwd, "", 19); // Your share user password - strncpy (GCSettings.smbshare, "", 19); // Share name on server - - GCSettings.smbip[15] = 0; - GCSettings.smbuser[19] = 0; - GCSettings.smbpwd[19] = 0; - GCSettings.smbshare[19] = 0; } diff --git a/source/ngc/preferences.cpp b/source/ngc/preferences.cpp index 1fbd741..952295d 100644 --- a/source/ngc/preferences.cpp +++ b/source/ngc/preferences.cpp @@ -437,8 +437,13 @@ LoadPrefsFromMethod (char * path) FreeSaveBuffer (); if(retval) + { strcpy(prefpath, path); + if(appPath[0] == 0) + strcpy(appPath, prefpath); + } + return retval; } @@ -454,14 +459,16 @@ bool LoadPrefs() return true; bool prefFound = false; - char filepath[4][MAXPATHLEN]; + char filepath[5][MAXPATHLEN]; int numDevices; #ifdef HW_RVL - numDevices = 3; + numDevices = 5; sprintf(filepath[0], "%s", appPath); - sprintf(filepath[1], "sd:/%s", APPFOLDER); - sprintf(filepath[2], "usb:/%s", APPFOLDER); + sprintf(filepath[1], "sd:/apps/%s", APPFOLDER); + sprintf(filepath[2], "usb:/apps/%s", APPFOLDER); + sprintf(filepath[3], "sd:/%s", APPFOLDER); + sprintf(filepath[4], "usb:/%s", APPFOLDER); #else numDevices = 2; sprintf(filepath[0], "carda:/%s", APPFOLDER);