MCPcopy Create free account
hub / github.com/dborth/fceugx / LoadPrefs

Function LoadPrefs

source/preferences.cpp:619–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617static bool prefLoadAttempted = false;
618
619bool LoadPrefs()
620{
621 if(prefLoadAttempted) // already attempted loading
622 return true;
623
624 prefLoadAttempted = true;
625
626 bool prefFound = false;
627 char filepath[5][MAXPATHLEN];
628 int numDevices;
629
630#ifdef HW_RVL
631 numDevices = 5;
632 sprintf(filepath[0], "%s", appPath);
633 sprintf(filepath[1], "sd:/apps/%s", APPFOLDER);
634 sprintf(filepath[2], "usb:/apps/%s", APPFOLDER);
635 sprintf(filepath[3], "sd:/%s", APPFOLDER);
636 sprintf(filepath[4], "usb:/%s", APPFOLDER);
637#else
638 numDevices = 4;
639 sprintf(filepath[0], "carda:/%s", APPFOLDER);
640 sprintf(filepath[1], "cardb:/%s", APPFOLDER);
641 sprintf(filepath[2], "port2:/%s", APPFOLDER);
642 sprintf(filepath[3], "gcloader:/%s", APPFOLDER);
643#endif
644
645 for(int i=0; i<numDevices; i++) {
646 prefFound = LoadPrefsFromMethod(filepath[i]);
647
648 if(prefFound)
649 break;
650 }
651
652 if(!prefFound) {
653 return false;
654 }
655
656 FixInvalidSettings();
657
658 if(GCSettings.videomode > VIDEOMODE_AUTOMATIC) {
659 ResetVideo_Menu();
660 }
661
662#ifdef HW_RVL
663 bg_music = (u8 * )bg_music_ogg;
664 bg_music_size = bg_music_ogg_size;
665 LoadBgMusic();
666#endif
667
668 ChangeLanguage();
669 return true;
670}
671
672void CreatePathWithPrefix(int device, const char* folder) {
673 char fullPath[MAXPATHLEN];

Callers 2

MainMenuFunction · 0.85
mainFunction · 0.85

Calls 5

LoadPrefsFromMethodFunction · 0.85
FixInvalidSettingsFunction · 0.85
ResetVideo_MenuFunction · 0.85
LoadBgMusicFunction · 0.85
ChangeLanguageFunction · 0.85

Tested by

no test coverage detected