From 841a4d41faf8380e1b387e0c855f54165cc38d40 Mon Sep 17 00:00:00 2001 From: Takumi Sueda Date: Wed, 20 Apr 2022 00:18:02 +0900 Subject: [PATCH] Fallback to NAND3 if no SD card is available --- main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index a0b232d..3fde933 100644 --- a/main.cpp +++ b/main.cpp @@ -53,8 +53,12 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR lpCmd, int nShow) file = CreateFile(L"\\Storage Card\\version.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (file == INVALID_HANDLE_VALUE) { - MessageBox(NULL, L"Failed to create \\Storage Card\\version.txt", L"(X_X) < OMG", MB_ICONWARNING); - return 1; + file = CreateFile(L"\\NAND3\\version.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) + { + MessageBox(NULL, L"Failed to create \\Storage Card\\version.txt and \\NAND3\\version.txt", L"(X_X) < OMG", MB_ICONWARNING); + return 1; + } } if (!WriteFile(file, buf, fileSize, NULL, NULL))