ret = srvSysGetServiceHandle(&fsldrHandle, "fs:LDR");
if (R_SUCCEEDED(ret)) {
fsldrPatchPermissions();
- ret = FSLDR_InitializeWithSdkVersion(fsldrHandle, SDK_VERSION);
- ret = FSLDR_SetPriority(0);
+ ret = FSLDR_Initialize(fsldrHandle);
if (R_FAILED(ret))
svcBreak(USERBREAK_ASSERT); // Can't properly panic here; no logger
} else {
}
Result
-FSLDR_InitializeWithSdkVersion(Handle session, u32 version)
+FSLDR_Initialize(Handle session)
{
u32 *cmdbuf = getThreadCommandBuffer();
- cmdbuf[0] = IPC_MakeHeader(0x861, 1, 2); // 0x8610042
- cmdbuf[1] = version;
- cmdbuf[2] = 32;
+ cmdbuf[0] = IPC_MakeHeader(0x801, 0, 2); // 0x8010002
+ cmdbuf[1] = 32;
Result ret = 0;
if (R_FAILED(ret = svcSendSyncRequest(session)))
return cmdbuf[1];
}
-Result
-FSLDR_SetPriority(u32 priority)
-{
- u32 *cmdbuf = getThreadCommandBuffer();
-
- cmdbuf[0] = IPC_MakeHeader(0x862, 1, 0); // 0x8620040
- cmdbuf[1] = priority;
-
- Result ret = 0;
- if (R_FAILED(ret = svcSendSyncRequest(fsldrHandle)))
- return ret;
-
- return cmdbuf[1];
-}
-
Result
FSLDR_OpenFileDirectly(Handle *out, FS_ArchiveID archiveId, FS_Path archivePath, FS_Path filePath, u32 openFlags, u32 attributes)
{
#include <3ds/types.h>
Result fsldrInit(void);
-void fsldrExit(void);
-Result FSLDR_InitializeWithSdkVersion(Handle session, u32 version);
+void fsldrExit(void);
+
+Result FSLDR_Initialize(Handle session);
Result FSLDR_SetPriority(u32 priority);
Result FSLDR_OpenFileDirectly(Handle *out, FS_ArchiveID archiveId, FS_Path archivePath, FS_Path filePath, u32 openFlags, u32 attributes);
Result FSLDR_GetNandCid(u8* out, u32 length);
-// 'Tis not ready for the world at large yet.
-// I don't want to delete it since I'm working on it though,
-// so it's temporarliy #if'd 0.
+// This is a thin shim used to set the right parameters and include the interpreter from toplevel code.
#include <3ds.h>
#include <stdlib.h>
#include "patcher.h"
// Yes, we're including a C file. Problem?
#include "../../../source/interpreter.c"
-#if 0
-
-#endif