From 5bcd3987a2f5d1f9700725e1e864a0e43ca0cb7f Mon Sep 17 00:00:00 2001 From: niklascfw Date: Tue, 17 Feb 2026 20:28:15 +0100 Subject: [PATCH] UHS warning: recommend Samsung EVO Plus, EVO Select, PRO Plus Co-authored-by: Cursor --- source/main.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/source/main.c b/source/main.c index e16382d..aa25ae3 100644 --- a/source/main.c +++ b/source/main.c @@ -428,6 +428,63 @@ void ipl_main(void) { gfx_con_setpos(0, 0); print_header(); + // UHS class check: recommend U2 / V30 / A2 for emuMMC (speed and reliability) + #define UHS_U2_MIN 2 + #define UHS_V30_MIN 30 + #define UHS_A2_MIN 2 + bool uhs_ok = (sd_storage.ssr.uhs_grade >= UHS_U2_MIN && + sd_storage.ssr.video_class >= UHS_V30_MIN && + sd_storage.ssr.app_class >= UHS_A2_MIN); + if (!uhs_ok) { + jc_init_hw(); + gfx_clear_grey(0x1B); + gfx_con_setpos(0, 0); + set_color(COLOR_RED); + gfx_printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + gfx_printf("!! WARNUNG - SD-KARTEN-KLASSE !!\n"); + gfx_printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n"); + set_color(COLOR_WHITE); + gfx_printf("Diese SD-Karte erfuellt NICHT die empfohlenen\n"); + gfx_printf("Mindestanforderungen (U2 | V30 | A2).\n\n"); + set_color(COLOR_YELLOW); + gfx_printf("Aktuelle Werte: UHS%d | V%d | A%d\n\n", + (u32)sd_storage.ssr.uhs_grade, + (u32)sd_storage.ssr.video_class, + (u32)sd_storage.ssr.app_class); + set_color(COLOR_WHITE); + gfx_printf("Moegliche Folgen bei schwachen Karten:\n"); + gfx_printf(" - Langsamere emuMMC / Spiel-Ladezeiten\n"); + gfx_printf(" - Hoheres Risiko von Korruption oder Abstuerzen\n"); + gfx_printf(" - Instabilitaet beim Schreiben groesserer Daten\n\n"); + set_color(COLOR_CYAN); + gfx_printf("Empfohlen: U2 | V30 | A2 oder besser.\n"); + gfx_printf("Empfohlene Karten: Samsung EVO Plus, EVO Select und PRO Plus.\n\n"); + set_color(COLOR_GREEN); + gfx_printf("Druecke A (oder Power), um trotzdem fortzufahren.\n"); + set_color(COLOR_WHITE); + while (btn_read() & BTN_POWER) { msleep(50); } + bool acknowledged = false; + while (!acknowledged) { + u8 btn_state = btn_read(); + if (btn_state & BTN_POWER) acknowledged = true; + jc_gamepad_rpt_t *jc = joycon_poll(); + if (jc && jc->a) acknowledged = true; + msleep(50); + } + // Wait for A and Power to be released so the same press doesn't start the install + while (btn_read() & BTN_POWER) { msleep(50); } + bool released = false; + while (!released) { + jc_gamepad_rpt_t *jc = joycon_poll(); + released = (!jc || !jc->a) && !(btn_read() & BTN_POWER); + if (!released) msleep(50); + } + msleep(300); // Short delay so the next screen is visible before accepting input + gfx_clear_grey(0x1B); + gfx_con_setpos(0, 0); + print_header(); + } + // Show information set_color(COLOR_CYAN); gfx_printf("Installationsmodus: %s\n", mode == INSTALL_MODE_UPDATE ? "Update" : "Saubere Installation");