mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-21 17:24:37 -05:00
Fix legacy config loading
This commit is contained in:
parent
fe5656b490
commit
a2bf9a8e64
2
Makefile
2
Makefile
|
|
@ -38,7 +38,7 @@ INCLUDES := inc inc/ui
|
|||
EXEFS_SRC := exefs_src
|
||||
APP_TITLE := JKSV
|
||||
APP_AUTHOR := JK
|
||||
APP_VERSION := 08.19.2021
|
||||
APP_VERSION := 08.31.2021
|
||||
ROMFS := romfs
|
||||
ICON := icon.jpg
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "gfx.h"
|
||||
|
||||
#define BLD_MON 8
|
||||
#define BLD_DAY 24
|
||||
#define BLD_DAY 31
|
||||
#define BLD_YEAR 2021
|
||||
|
||||
namespace data
|
||||
|
|
|
|||
22
src/cfg.cpp
22
src/cfg.cpp
|
|
@ -190,7 +190,7 @@ static void loadWorkDirLegacy()
|
|||
memset(tmp, 0, 256);
|
||||
|
||||
FILE *getDir = fopen(workDirLegacy, "r");
|
||||
fgets(tmp, FS_MAX_PATH, getDir);
|
||||
fgets(tmp, 256, getDir);
|
||||
fclose(getDir);
|
||||
std::string tmpStr = tmp;
|
||||
util::stripChar('\n', tmpStr);
|
||||
|
|
@ -227,13 +227,13 @@ static void loadConfigLegacy()
|
|||
cfg::config["zip"] = cfgIn >> 51 & 1;
|
||||
cfg::config["langOverride"] = cfgIn >> 50 & 1;
|
||||
cfg::config["trashBin"] = cfgIn >> 49 & 1;
|
||||
fs::delfile(cfgPath);
|
||||
fs::delfile(legacyCfgPath.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
static void loadFavoritesLegacy()
|
||||
{
|
||||
std::string legacyFavPath = fs::getWorkDir() + "cfg::favorites.txt";
|
||||
std::string legacyFavPath = fs::getWorkDir() + "favorites.txt";
|
||||
if(fs::fileExists(legacyFavPath))
|
||||
{
|
||||
fs::dataFile fav(legacyFavPath);
|
||||
|
|
@ -246,7 +246,7 @@ static void loadFavoritesLegacy()
|
|||
|
||||
static void loadBlacklistLegacy()
|
||||
{
|
||||
std::string legacyBlPath = fs::getWorkDir() + "cfg::blacklist.txt";
|
||||
std::string legacyBlPath = fs::getWorkDir() + "blacklist.txt";
|
||||
if(fs::fileExists(legacyBlPath))
|
||||
{
|
||||
fs::dataFile bl(legacyBlPath);
|
||||
|
|
@ -257,20 +257,19 @@ static void loadBlacklistLegacy()
|
|||
}
|
||||
}
|
||||
|
||||
static void loadTitleDefs()
|
||||
static void loadTitleDefsLegacy()
|
||||
{
|
||||
std::string titleDefLegacy = fs::getWorkDir() + "titleDefs.txt";
|
||||
if(fs::fileExists(titleDefLegacy))
|
||||
rename(titleDefLegacy.c_str(), titleDefPath);
|
||||
|
||||
if(fs::fileExists(titleDefPath))
|
||||
{
|
||||
fs::dataFile getPaths(titleDefPath);
|
||||
fs::dataFile getPaths(titleDefLegacy);
|
||||
while(getPaths.readNextLine(true))
|
||||
{
|
||||
uint64_t tid = strtoul(getPaths.getName().c_str(), NULL, 16);
|
||||
pathDefs[tid] = getPaths.getNextValueStr();
|
||||
}
|
||||
getPaths.close();
|
||||
fs::delfile(titleDefLegacy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -280,6 +279,7 @@ void cfg::loadConfig()
|
|||
loadConfigLegacy();
|
||||
loadFavoritesLegacy();
|
||||
loadBlacklistLegacy();
|
||||
loadTitleDefsLegacy();
|
||||
|
||||
if(fs::fileExists(cfgPath))
|
||||
{
|
||||
|
|
@ -380,10 +380,12 @@ void cfg::loadConfig()
|
|||
case 18:
|
||||
cfg::config["autoName"] = textToBool(cfgRead.getNextValueStr());
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
loadTitleDefs();
|
||||
}
|
||||
|
||||
static void savePathDefs()
|
||||
|
|
|
|||
|
|
@ -110,8 +110,11 @@ void fs::createSaveData_t(void *a)
|
|||
|
||||
FsSaveDataMetaInfo meta;
|
||||
memset(&meta, 0, sizeof(FsSaveDataMetaInfo));
|
||||
meta.size = 0x40060;
|
||||
meta.type = FsSaveDataMetaType_Thumbnail;
|
||||
if(s->type != FsSaveDataType_Bcat)
|
||||
{
|
||||
meta.size = 0x40060;
|
||||
meta.type = FsSaveDataMetaType_Thumbnail;
|
||||
}
|
||||
|
||||
Result res = 0;
|
||||
if(R_SUCCEEDED(res = fsCreateSaveDataFileSystem(&attr, &svCreate, &meta)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user