From fb12edcbbaa5ef7a08fbb44d4aa13f0f37136537 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 31 Jan 2019 03:23:28 -0800 Subject: [PATCH] use svcCallSecureMonitor instead of talking to spl. --- source/firmware_version.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/firmware_version.cpp b/source/firmware_version.cpp index ec430aee..821e53f7 100644 --- a/source/firmware_version.cpp +++ b/source/firmware_version.cpp @@ -35,7 +35,16 @@ static void _CacheValues(void) } u32 target_fw = 0; - GetAtmosphereApiVersion(nullptr, nullptr, nullptr, &target_fw, nullptr); + { + SecmonArgs args = {0}; + args.X[0] = 0xC3000002; /* smcGetConfig */ + args.X[1] = 65000; /* ConfigItem_ExosphereVersion */ + if (R_FAILED(svcCallSecureMonitor(&args)) || args.X[0] != 0) { + std::abort(); + } + + target_fw = (args.X[1] >> 0x08) & 0xFF; + } switch (static_cast(target_fw)) { case AtmosphereTargetFirmware_100: