From c7a3a0278cbaafee047de5bf683efbb8c243b2dc Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 28 Apr 2020 10:42:30 +0100 Subject: [PATCH] add quick luma detection getinfo --- k11_extension/source/svc/GetSystemInfo.c | 16 +++++++++++++++- sysmodules/loader/source/main.c | 14 +++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/k11_extension/source/svc/GetSystemInfo.c b/k11_extension/source/svc/GetSystemInfo.c index 7f30cc5..5b1cf42 100644 --- a/k11_extension/source/svc/GetSystemInfo.c +++ b/k11_extension/source/svc/GetSystemInfo.c @@ -83,6 +83,7 @@ Result GetSystemInfoHook(s64 *out, s32 type, s32 param) break; default: + *out = 0; res = 0xF8C007F4; // not implemented break; } @@ -105,13 +106,16 @@ Result GetSystemInfoHook(s64 *out, s32 type, s32 param) *out = L2C_CTRL & 1; break; default: + *out = 0; res = 0xF8C007F4; break; } } else + { + *out = 0; res = 0xF8C007F4; - + } break; } @@ -128,7 +132,10 @@ Result GetSystemInfoHook(s64 *out, s32 type, s32 param) if((u32)param <= getNumberOfCores()) *out = L1MMUTableAddrs[param - 1]; else + { + *out = 0; res = 0xF8C007F4; + } break; } @@ -136,6 +143,13 @@ Result GetSystemInfoHook(s64 *out, s32 type, s32 param) break; } + + case 0x20000: + { + *out = 0; + return 1; + } + default: GetSystemInfo(out, type, param); break; diff --git a/sysmodules/loader/source/main.c b/sysmodules/loader/source/main.c index 7966312..7b91768 100644 --- a/sysmodules/loader/source/main.c +++ b/sysmodules/loader/source/main.c @@ -29,18 +29,18 @@ static inline void loadCFWInfo(void) { s64 out; - assertSuccess(svcGetSystemInfo(&out, 0x10000, 3)); + if(svcGetSystemInfo(&out, 0x20000, 0) != 1) panic(0xDEADCAFE); + + svcGetSystemInfo(&out, 0x10000, 3); config = (u32)out; - assertSuccess(svcGetSystemInfo(&out, 0x10000, 4)); + svcGetSystemInfo(&out, 0x10000, 4); multiConfig = (u32)out; - assertSuccess(svcGetSystemInfo(&out, 0x10000, 5)); + svcGetSystemInfo(&out, 0x10000, 5); bootConfig = (u32)out; - assertSuccess(svcGetSystemInfo(&out, 0x10000, 0x201)); + svcGetSystemInfo(&out, 0x10000, 0x201); isN3DS = (bool)out; - //assertSuccess(svcGetSystemInfo(&out, 0x10000, 0x202)); - //needToInitSd = (bool)out; - assertSuccess(svcGetSystemInfo(&out, 0x10000, 0x203)); + svcGetSystemInfo(&out, 0x10000, 0x203); isSdMode = (bool)out; }