- some minor misc. changes.

This commit is contained in:
Fledge68 2021-11-12 18:11:42 -06:00
parent 7f4f6ea2fc
commit a45cc4cbdf
5 changed files with 17 additions and 20 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@ -1241,17 +1241,11 @@ void Nand::SetPaths(const char *emuPath, const char *currentPart)
/* emuPath should = /nands/nand_name */ /* emuPath should = /nands/nand_name */
/* set wiiflow full nand path */ /* set wiiflow full nand path */
snprintf(FullNANDPath, sizeof(FullNANDPath), "%s:%s", currentPart, emuPath); snprintf(FullNANDPath, sizeof(FullNANDPath), "%s:%s", currentPart, emuPath);// example - sd:/nands/default
// example - sd:/nands/default
/* set IOS compatible NAND Path */ /* set IOS compatible NAND Path */
strncpy(NandPath, emuPath, sizeof(NandPath)); memset(NandPath, 0, sizeof(NandPath));
// example - /nands/default strncpy(NandPath, emuPath, sizeof(NandPath) - 1);
NandPath[sizeof(NandPath) - 1] = '\0';
if(strlen(NandPath) == 0)
strcat(NandPath, "/");
} }
/* /*

View File

@ -56,8 +56,8 @@ extern volatile bool NANDemuView;
extern volatile bool networkInit; extern volatile bool networkInit;
extern u8 currentPartition; extern u8 currentPartition;
extern u8 currentPort; extern u8 currentPort;
extern char wii_games_dir[]; extern char wii_games_dir[64];
extern char gc_games_dir[]; extern char gc_games_dir[64];
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -148,7 +148,8 @@ void CMenu::_Explorer(void)
if(strchr(dir, '/') != NULL) if(strchr(dir, '/') != NULL)
*(strrchr(dir, '/')+1) = '\0'; *(strrchr(dir, '/')+1) = '\0';
} }
strcpy(folderPath, dir); strcpy(folderPath, dir);// copy dir path to folderPath. folderPath is what is display on screen.
//if dir is just device and : then clear path completely //if dir is just device and : then clear path completely
if(strchr(dir, '/') == NULL) if(strchr(dir, '/') == NULL)
{ {
@ -158,7 +159,7 @@ void CMenu::_Explorer(void)
else if(strchr(folderPath, '/') != strrchr(folderPath, '/')) else if(strchr(folderPath, '/') != strrchr(folderPath, '/'))
{ {
*strrchr(folderPath, '/') = '\0'; *strrchr(folderPath, '/') = '\0';
while(strlen(folderPath) > 48) while(strlen(folderPath) > 48)// shrink onscreen folder path down to 48 characters to fit on screen
{ {
if(strchr(folderPath, '/') == strrchr(folderPath, '/')) if(strchr(folderPath, '/') == strrchr(folderPath, '/'))
break; break;
@ -166,7 +167,7 @@ void CMenu::_Explorer(void)
strncpy(tmpPath, strchr(folderPath, '/') + 1, MAX_FAT_PATH - 1); strncpy(tmpPath, strchr(folderPath, '/') + 1, MAX_FAT_PATH - 1);
strcpy(folderPath, tmpPath); strcpy(folderPath, tmpPath);
} }
memset(tmpPath, 0, MAX_FAT_PATH); memset(tmpPath, 0, MAX_FAT_PATH);// now add beginning and ending '/''s to folderPath
if(strchr(folderPath, ':') == NULL) if(strchr(folderPath, ':') == NULL)
strcpy(tmpPath, "/"); strcpy(tmpPath, "/");
strcat(tmpPath, folderPath); strcat(tmpPath, folderPath);

View File

@ -176,9 +176,9 @@ void CMenu::_Paths(void)
_hidePaths(); _hidePaths();
currentPartition = m_cfg.getInt(WII_DOMAIN, "partition", USB1); currentPartition = m_cfg.getInt(WII_DOMAIN, "partition", USB1);
path = _FolderExplorer(fmt(wii_games_dir, DeviceName[currentPartition])); path = _FolderExplorer(fmt(wii_games_dir, DeviceName[currentPartition]));
if(strlen(path) > 6)// "usb1:/" if(strchr(path, '/') != NULL)// path includes a folder and not just sd: or usb:
{ {
if(strncmp(path, "sd:/", 4) == 0) if(strncmp(path, "sd:", 3) == 0)
m_cfg.setInt(WII_DOMAIN, "partition", 0); m_cfg.setInt(WII_DOMAIN, "partition", 0);
else else
{ {
@ -187,7 +187,8 @@ void CMenu::_Paths(void)
} }
string tmpPath = "%s" + string(strchr(path, ':')); string tmpPath = "%s" + string(strchr(path, ':'));
m_cfg.setString(WII_DOMAIN, "wii_games_dir", tmpPath); m_cfg.setString(WII_DOMAIN, "wii_games_dir", tmpPath);
strcpy(wii_games_dir, tmpPath.c_str()); memset(wii_games_dir, 0, sizeof(wii_games_dir));
strncpy(wii_games_dir, tmpPath.c_str(), sizeof(wii_games_dir) - 1);
m_cfg.setBool(WII_DOMAIN, "update_cache", true); m_cfg.setBool(WII_DOMAIN, "update_cache", true);
if(m_current_view & COVERFLOW_WII) if(m_current_view & COVERFLOW_WII)
m_refreshGameList = true; m_refreshGameList = true;
@ -199,9 +200,9 @@ void CMenu::_Paths(void)
_hidePaths(); _hidePaths();
currentPartition = m_cfg.getInt(GC_DOMAIN, "partition", USB1); currentPartition = m_cfg.getInt(GC_DOMAIN, "partition", USB1);
path = _FolderExplorer(fmt(gc_games_dir, DeviceName[currentPartition])); path = _FolderExplorer(fmt(gc_games_dir, DeviceName[currentPartition]));
if(strlen(path) > 6)// "usb1:/" if(strchr(path, '/') != NULL)// path includes a folder and not just sd: or usb:
{ {
if(strncmp(path, "sd:/", 4) == 0) if(strncmp(path, "sd:", 3) == 0)
m_cfg.setInt(GC_DOMAIN, "partition", 0); m_cfg.setInt(GC_DOMAIN, "partition", 0);
else else
{ {
@ -211,7 +212,8 @@ void CMenu::_Paths(void)
} }
string tmpPath = "%s" + string(strchr(path, ':')); string tmpPath = "%s" + string(strchr(path, ':'));
m_cfg.setString(GC_DOMAIN, "gc_games_dir", tmpPath); m_cfg.setString(GC_DOMAIN, "gc_games_dir", tmpPath);
strcpy(gc_games_dir, tmpPath.c_str()); memset(gc_games_dir, 0, sizeof(gc_games_dir));
strncpy(gc_games_dir, tmpPath.c_str(), sizeof(gc_games_dir) - 1);
m_cfg.setBool(GC_DOMAIN, "update_cache", true); m_cfg.setBool(GC_DOMAIN, "update_cache", true);
if(m_current_view & COVERFLOW_GAMECUBE) if(m_current_view & COVERFLOW_GAMECUBE)
m_refreshGameList = true; m_refreshGameList = true;