Fallback to NAND3 if no SD card is available

This commit is contained in:
Takumi Sueda 2022-04-20 00:18:02 +09:00
parent d569fb1b5c
commit 841a4d41fa

View File

@ -53,9 +53,13 @@ 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); file = CreateFile(L"\\Storage Card\\version.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (file == INVALID_HANDLE_VALUE) if (file == INVALID_HANDLE_VALUE)
{ {
MessageBox(NULL, L"Failed to create \\Storage Card\\version.txt", L"(X_X) < OMG", MB_ICONWARNING); 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; return 1;
} }
}
if (!WriteFile(file, buf, fileSize, NULL, NULL)) if (!WriteFile(file, buf, fileSize, NULL, NULL))
{ {