Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/n3ds/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ static void N3DS_drawFallbackRoomBorder(void) {

static char* chooseDataWinPath(void) {
if (fileExists("romfs:/data.win")) return safeStrdup("romfs:/data.win");
if (fileExists("romfs:/game.unx")) return safeStrdup("romfs:/game.unx");
if (fileExists("sdmc:/3ds/cinnamon/game.unx")) return safeStrdup("sdmc:/3ds/cinnamon/game.unx");
return safeStrdup("sdmc:/3ds/cinnamon/data.win");
}

Expand Down
21 changes: 18 additions & 3 deletions tools/n3ds-preprocess/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4247,7 +4247,7 @@ static bool resolveUndertaleDataWinPath(const char* candidate, char* dataWinPath
if (candidate == NULL || candidate[0] == '\0') return false;

if (fileExists(candidate)) {
if (stringContainsIgnoreCase(candidate, "data.win")) {
if (stringContainsIgnoreCase(candidate, "data.win") || stringContainsIgnoreCase(candidate, "game.unx")) {
snprintf(dataWinPath, dataWinPathSize, "%s", candidate);
return true;
}
Expand All @@ -4266,6 +4266,15 @@ static bool resolveUndertaleDataWinPath(const char* candidate, char* dataWinPath
snprintf(dataWinPath, dataWinPathSize, "%s", directPath);
return true;
}
#if N3DS_PREPROCESS_HOST_WINDOWS
snprintf(directPath, sizeof(directPath), "%s\\game.unx", candidate);
#else
snprintf(directPath, sizeof(directPath), "%s/game.unx", candidate);
#endif
if (fileExists(directPath)) {
snprintf(dataWinPath, dataWinPathSize, "%s", directPath);
return true;
}

#if N3DS_PREPROCESS_HOST_WINDOWS
snprintf(directPath, sizeof(directPath), "%s\\UNDERTALE.exe", candidate);
Expand All @@ -4277,6 +4286,12 @@ static bool resolveUndertaleDataWinPath(const char* candidate, char* dataWinPath
snprintf(dataWinPath, dataWinPathSize, "%s\\data.win", candidate);
#else
snprintf(dataWinPath, dataWinPathSize, "%s/data.win", candidate);
#endif
if (fileExists(dataWinPath)) return true;
#if N3DS_PREPROCESS_HOST_WINDOWS
snprintf(dataWinPath, dataWinPathSize, "%s\\game.unx", candidate);
#else
snprintf(dataWinPath, dataWinPathSize, "%s/game.unx", candidate);
#endif
if (fileExists(dataWinPath)) return true;
}
Expand Down Expand Up @@ -4978,8 +4993,8 @@ int main(int argc, char** argv) {
}

if (!normalizeInputDataWinPath(&options)) {
fprintf(stderr, "Could not resolve data.win from: %s\n", options.inputPath);
fprintf(stderr, "Pass either the Undertale folder or the full path to data.win.\n");
fprintf(stderr, "Could not resolve data.win or game.unx from: %s\n", options.inputPath);
fprintf(stderr, "Pass either the Undertale folder or the full path to data.win or game.unx.\n");
return 1;
}

Expand Down