Skip to content

Commit 0e79e72

Browse files
committed
Change path determination
1 parent 9a8da67 commit 0e79e72

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

source/dumper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
bool dump_done = false;
1313
bool exfat = false;
14-
std::string outPath = "sdmc:/" + getCFW() + "/contents/01006A800016E000/romfs/data.arc";
14+
std::string outPath = dataArcPath(getCFW());
1515
const int MD5_DIGEST_LENGTH = 16;
1616

1717
void md5HashFromFile(std::string filename, unsigned char* out)

source/mod_installer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ std::list<std::string> modDirList;
4242

4343
const char* mods_root = "sdmc:/UltimateModManager/mods/";
4444
const char* backups_root = "sdmc:/UltimateModManager/backups/";
45-
std::string arc_path = "sdmc:/" + getCFW() + "/contents/01006A800016E000/romfs/data.arc";
45+
std::string arc_path = dataArcPath(getCFW());
4646

4747
int regionIndex = getRegion();
4848

source/utils.h

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const u64 smashTID = 0x01006A800016E000;
1010
const char* manager_root = "sdmc:/UltimateModManager/";
1111
const char* tablePath = "sdmc:/UltimateModManager/compTable.backup";
1212
bool applicationMode = false;
13-
enum smashRegions{
13+
enum smashRegions {
1414
jp_ja,
1515
us_en,
1616
us_fr,
@@ -171,13 +171,34 @@ bool isServiceRunning(const char *serviceName) {
171171
return running;
172172
}
173173

174-
std::string getCFW()
174+
enum cfwName {
175+
atmosphere,
176+
sxos,
177+
ReiNX,
178+
};
179+
cfwName getCFW()
175180
{
176181
if (isServiceRunning("rnx"))
177-
return "ReiNX";
182+
return ReiNX;
178183
if (isServiceRunning("tx"))
179-
return "sxos";
180-
return "atmosphere";
184+
return sxos;
185+
return atmosphere;
186+
}
187+
188+
std::string dataArcPath(cfwName cfw) {
189+
std::string path;
190+
switch(cfw) {
191+
case atmosphere:
192+
path = "sdmc:/atmosphere/contents/01006A800016E000/romfs/data.arc";
193+
break;
194+
case sxos:
195+
path = "sdmc:/sxos/titles/01006A800016E000/romfs/data.arc";
196+
break;
197+
case ReiNX:
198+
path = "sdmc:/ReiNX/titles/01006A800016E000/romfs/data.arc";
199+
break;
200+
}
201+
return path;
181202
}
182203

183204
u64 runningTID()

0 commit comments

Comments
 (0)