Skip to content

Commit

Permalink
Use product code for japanese titles
Browse files Browse the repository at this point in the history
While it should support dumping japanese games, it doesn't seem to be working properly (in some cases at least)!

Fixes #32
Fixes #31
  • Loading branch information
Crementif committed Apr 6, 2023
1 parent 89f85c6 commit 214b53b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion assets/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<app version="1">
<name>dumpling</name>
<coder>Crementif and emiyl</coder>
<version>2.6.2</version>
<version>2.6.3</version>
<release_date>20200813200000</release_date>
<short_description>Simple Cemu File Dumper</short_description>
<long_description>A simple, all-in-one Wii U file dumper! Developed with the intent of making dumping games and other files for Cemu faster and easier.</long_description>
Expand Down
12 changes: 3 additions & 9 deletions source/app/dumping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,23 +241,17 @@ bool walkDirectoryRecursive(const std::string& srcPath, const std::string& destP
if (dirEntry != nullptr) {
std::string entrySrcPath = srcPath + "/" + dirEntry->d_name;
std::string entryDstPath = destPath + "/" + dirEntry->d_name;
// Use lstat since readdir returns DT_REG for symlinks
struct stat fileStat{};
if (lstat(entrySrcPath.c_str(), &fileStat) != 0) {
setErrorPrompt(L"Unknown Error "+std::to_wstring(errno)+L":\nCouldn't check type of file/folder!\n"+toWstring(entrySrcPath));
return false;
}
if (S_ISLNK(fileStat.st_mode)) {
if (dirEntry->d_type == DT_LNK) {
continue;
}
else if (S_ISREG(fileStat.st_mode)) {
else if (dirEntry->d_type == DT_REG) {
// Copy file
if (!callback(WALK_EVENT::FILE, dirEntry->d_name, entrySrcPath, entryDstPath)) {
closedir(dirHandle);
return false;
}
}
else if (S_ISDIR(fileStat.st_mode)) {
else if (dirEntry->d_type == DT_DIR) {
// Ignore root and parent folder entries
if (strcmp(dirEntry->d_name, ".") == 0 || strcmp(dirEntry->d_name, "..") == 0) continue;

Expand Down
6 changes: 3 additions & 3 deletions source/app/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void showLoadingScreen() {
WHBLogFreetypeSetBackgroundColor(0x0b5d5e00);
WHBLogFreetypeSetFontColor(0xFFFFFFFF);
WHBLogFreetypeSetFontSize(22);
WHBLogPrint("Dumpling V2.6.2");
WHBLogPrint("Dumpling V2.6.3");
WHBLogPrint("-- Made by Crementif and Emiyl --");
WHBLogPrint("");
WHBLogFreetypeDraw();
Expand All @@ -31,15 +31,15 @@ void showMainMenu() {
while(!startSelectedOption) {
// Print menu text
WHBLogFreetypeStartScreen();
WHBLogFreetypePrint(L"Dumpling V2.6.2");
WHBLogFreetypePrint(L"Dumpling V2.6.3");
WHBLogFreetypePrint(L"===============================");
WHBLogFreetypePrintf(L"%C Dump a game disc", OPTION(0));
WHBLogFreetypePrintf(L"%C Dump digital games", OPTION(1));
WHBLogFreetypePrint(L"");
WHBLogFreetypePrintf(L"%C Dump files to use Cemu online", OPTION(2));
WHBLogFreetypePrintf(L"%C Dump Wii U applications (e.g. Friend List, eShop etc.)", OPTION(3));
// WHBLogFreetypePrintf("%C Dump Amiibo Files", OPTION(4));
WHBLogFreetypePrintf(L"");
WHBLogFreetypePrint(L"");
WHBLogFreetypePrintf(L"%C Dump only Base files of a game", OPTION(4));
WHBLogFreetypePrintf(L"%C Dump only Update files of a game", OPTION(5));
WHBLogFreetypePrintf(L"%C Dump only DLC files of a game", OPTION(6));
Expand Down
14 changes: 10 additions & 4 deletions source/app/titles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ bool getTitleMetaXml(titleEntry& title, titlePart& part) {
title.shortTitle = shortTitleJapan;
}
title.folderName = normalizeFolderName(title.shortTitle);
if (title.folderName.size() <= 2) {
title.folderName = normalizeFolderName(title.productCode);
}
part.outputPath += title.folderName;
return true;
}
Expand Down Expand Up @@ -118,6 +121,9 @@ bool getSaveMetaXml(titleEntry& title, savePart& part) {
title.shortTitle = shortTitleJapan;
}
title.folderName = normalizeFolderName(title.shortTitle);
if (title.folderName.size() <= 2) {
title.folderName = normalizeFolderName(title.productCode);
}
part.outputPath = "/Saves/" + title.folderName + "/" + part.outputPath;
return true;
}
Expand Down Expand Up @@ -186,7 +192,7 @@ bool getSaveList(const std::string& saveDirPath) {

struct dirent* highDirEntry;
while ((highDirEntry = readdir(highDirHandle)) != nullptr) {
if ((highDirEntry->d_type & DT_DIR) != DT_DIR) continue;
if (highDirEntry->d_type != DT_DIR) continue;
if (strlen(highDirEntry->d_name) != 8) continue;

uint32_t highTitleId = strtoul((const char*)highDirEntry->d_name, nullptr, 16);
Expand All @@ -199,7 +205,7 @@ bool getSaveList(const std::string& saveDirPath) {

struct dirent* lowDirEntry;
while ((lowDirEntry = readdir(lowDirHandle)) != nullptr) {
if ((lowDirEntry->d_type & DT_DIR) != DT_DIR) continue;
if (lowDirEntry->d_type != DT_DIR) continue;
if (strlen(lowDirEntry->d_name) != 8) continue;

uint32_t lowTitleId = strtoul((const char*)&lowDirEntry->d_name, nullptr, 16);
Expand All @@ -214,7 +220,7 @@ bool getSaveList(const std::string& saveDirPath) {

struct dirent* userDirEntry;
while ((userDirEntry = readdir(userDirHandle)) != nullptr) {
if ((userDirEntry->d_type & DT_DIR) != DT_DIR) continue;
if (userDirEntry->d_type != DT_DIR) continue;

std::string userDirPath = lowDirPath + "user/" + userDirEntry->d_name;

Expand All @@ -225,7 +231,7 @@ bool getSaveList(const std::string& saveDirPath) {

struct dirent* contentDirEntry;
while ((contentDirEntry = readdir(contentDirHandle)) != nullptr) {
if ((contentDirEntry->d_type & DT_DIR) == DT_DIR || (contentDirEntry->d_type & DT_REG) == DT_REG) {
if (contentDirEntry->d_type == DT_DIR || contentDirEntry->d_type == DT_REG) {
// WHBLogPrint((userDirPath + contentDirEntry->d_name).c_str());
// WHBLogFreetypeDraw();
// sleep_for(500ms);
Expand Down

0 comments on commit 214b53b

Please sign in to comment.