so bascially rosalina's image...

was in BASE (hardcoded by kernel) while its heaps were in SYSTEM. Fix this; also put the kext where BASE was.
This commit is contained in:
TuxSH
2020-05-18 01:15:44 +01:00
parent b02d0346fd
commit adda19ecb2
11 changed files with 47 additions and 14 deletions

View File

@@ -3,11 +3,24 @@
#include "luma.h"
#include "util.h"
bool hasKExt(void)
{
s64 val;
return svcGetSystemInfo(&val, 0x20000, 0) == 1;
}
u32 getKExtSize(void)
{
s64 val;
Result res = svcGetSystemInfo(&val, 0x10000, 0x300);
return R_FAILED(res) ? 0 : (u32)val;
svcGetSystemInfo(&val, 0x10000, 0x300);
return (u32)val;
}
u32 getStolenSystemMemRegionSize(void)
{
s64 val;
svcGetSystemInfo(&val, 0x10000, 0x301);
return (u32)val;
}
bool isTitleLaunchPrevented(u64 titleId)

View File

@@ -2,5 +2,7 @@
#include <3ds/types.h>
bool hasKExt(void);
u32 getKExtSize(void);
bool isTitleLaunchPrevented(u64 titleId);
u32 getStolenSystemMemRegionSize(void);
bool isTitleLaunchPrevented(u64 titleId);

View File

@@ -243,7 +243,10 @@ static ReslimitValues *fixupReslimitValues(void)
{
// In order: APPLICATION, SYS_APPLET, LIB_APPLET, OTHER
// Fixup "commit" reslimit
u32 sysmemalloc = SYSMEMALLOC + getKExtSize();
// Note: we lie in the reslimit and make as if neither KExt nor Roslina existed, to avoid breakage
u32 sysmemalloc = SYSMEMALLOC + (hasKExt() ? getStolenSystemMemRegionSize() : 0);
ReslimitValues *values = !IS_N3DS ? g_o3dsReslimitValues : g_n3dsReslimitValues;
static const u32 minAppletMemAmount = 0x1200000;

View File

@@ -37,7 +37,7 @@ AccessControlInfo:
CoreVersion : 2
DescVersion : 2
MemoryType : System # Application / System / Base
MemoryType : Base # Application / System / Base
HandleTableSize: 150
MemoryMapping:

View File

@@ -62,7 +62,7 @@ Menu rosalinaMenu = {
bool rosalinaMenuShouldShowDebugInfo(void)
{
return false;
return true;
}
void RosalinaMenu_ShowDebugInfo(void)