From 6a261e356f1b2fa5d41734905414f87e1a7f3c99 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 12 Sep 2019 23:53:46 +0300 Subject: [PATCH] hos: Update NOGC for LAFW v3 And also add emuMMC reverse protection by disabling GC when 9.0.0 fuses are burnt and emuMMC is lower than this. This avoids fatals on boot. --- bootloader/hos/hos.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bootloader/hos/hos.c b/bootloader/hos/hos.c index 5fd8687..69c9beb 100644 --- a/bootloader/hos/hos.c +++ b/bootloader/hos/hos.c @@ -457,8 +457,13 @@ int hos_launch(ini_sec_t *cfg) config_kip1patch(&ctxt, "emummc"); } - // Check if fuses lower than 4.0.0 and if yes apply NO Gamecard patch. - if (h_cfg.autonogc && !(fuse_read_odm(7) & ~0xF) && ctxt.pkg1_id->kb >= KB_FIRMWARE_VERSION_400) + // Check if fuses lower than 4.0.0 or 9.0.0 and if yes apply NO Gamecard patch. + // Additionally check if running emuMMC and disable GC if v3 fuses are burnt and HOS is <= 8.1.0. + if ((h_cfg.autonogc && + ((!(fuse_read_odm(7) & ~0xF) && (ctxt.pkg1_id->kb >= KB_FIRMWARE_VERSION_400)) || // LAFW v2. + (!(fuse_read_odm(7) & ~0x3FF) && (ctxt.pkg1_id->kb >= KB_FIRMWARE_VERSION_900)))) // LAFW v3. + || ((emu_cfg.enabled && !h_cfg.emummc_force_disable) && + ((fuse_read_odm(7) & 0x400) && (ctxt.pkg1_id->kb <= KB_FIRMWARE_VERSION_810)))) config_kip1patch(&ctxt, "nogc"); gfx_printf("Loaded pkg1 & keyblob\n");