diff --git a/src/n3ds/main.c b/src/n3ds/main.c index 2fb74a70..b5263e9d 100644 --- a/src/n3ds/main.c +++ b/src/n3ds/main.c @@ -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"); } diff --git a/tools/n3ds-preprocess/main.c b/tools/n3ds-preprocess/main.c index 8e62c5f1..9d14a762 100644 --- a/tools/n3ds-preprocess/main.c +++ b/tools/n3ds-preprocess/main.c @@ -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; } @@ -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); @@ -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; } @@ -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; }