Skip to content

Commit a0a8dcc

Browse files
committed
Handle pre-boot FlipperMCE
1 parent 0f22fd0 commit a0a8dcc

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

libogc/mmce.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
mmce.c -- MMCE support
44
5-
Copyright (C) 2022 - 2025 Extrems' Corner.org
5+
Copyright (C) 2022 - 2026 Extrems' Corner.org
66
77
This software is provided 'as-is', without any express or implied
88
warranty. In no event will the authors be held liable for any
@@ -565,14 +565,17 @@ static bool __mmce_startup(DISC_INTERFACE *disc)
565565
__UnmaskIrq(IM_PI_DEBUG);
566566
}
567567

568-
MMCE_SetAccessMode(chan, MMCE_MODE_READWRITE);
568+
if (MMCE_SetAccessMode(chan, MMCE_MODE_READWRITE) == MMCE_RESULT_NOCARD)
569+
return __mmce_startup(disc);
569570

570-
if (MMCE_GetAccessMode(chan, &mode) == MMCE_RESULT_READY && mode == MMCE_MODE_READWRITE)
571-
disc->features |= FEATURE_MEDIUM_CANWRITE;
572-
else
573-
disc->features &= ~FEATURE_MEDIUM_CANWRITE;
571+
if (MMCE_GetAccessMode(chan, &mode) == MMCE_RESULT_READY) {
572+
if (mode == MMCE_MODE_READWRITE)
573+
disc->features |= FEATURE_MEDIUM_CANWRITE;
574+
else
575+
disc->features &= ~FEATURE_MEDIUM_CANWRITE;
576+
}
574577

575-
return true;
578+
return __MMCE[chan].attached;
576579
}
577580

578581
static bool __mmce_isInserted(DISC_INTERFACE *disc)

0 commit comments

Comments
 (0)