From 37544a0eb9f7e66a01823631ea9dfd0dc3a62ed9 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 30 Jun 2019 13:54:41 +0200 Subject: [PATCH 1/3] Fix process list --- sysmodules/rosalina/source/menus/process_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysmodules/rosalina/source/menus/process_list.c b/sysmodules/rosalina/source/menus/process_list.c index 43c3c76..91b274e 100644 --- a/sysmodules/rosalina/source/menus/process_list.c +++ b/sysmodules/rosalina/source/menus/process_list.c @@ -262,7 +262,7 @@ static void ProcessListMenu_MemoryViewer(const ProcessInfo *info) u32 max; } MenuData; - bool editing; + bool editing = false; MenuData menus[MENU_MODE_MAX] = {0}; int menuMode = MENU_MODE_NORMAL; From c9a578734e65723fdb0e70375ac7bca7f06e0d85 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 30 Jun 2019 22:59:44 +0200 Subject: [PATCH 2/3] Fix N3DS applications not closing properly (fix #1271, #1270, etc.) --- sysmodules/pm/source/info.c | 3 +++ sysmodules/pm/source/manager.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sysmodules/pm/source/info.c b/sysmodules/pm/source/info.c index a324580..ed43edf 100644 --- a/sysmodules/pm/source/info.c +++ b/sysmodules/pm/source/info.c @@ -11,6 +11,9 @@ Result registerProgram(u64 *programHandle, const FS_ProgramInfo *programInfo, co Result res = 0; if (IS_N3DS) { + if (pi.programId >> 48 == 0xFFFF) { + return LOADER_RegisterProgram(programHandle, &pi, &piu); + } pi.programId = (pi.programId & ~N3DS_TID_MASK) | N3DS_TID_BIT; piu.programId = (piu.programId & ~N3DS_TID_MASK) | N3DS_TID_BIT; res = LOADER_RegisterProgram(programHandle, &pi, &piu); diff --git a/sysmodules/pm/source/manager.c b/sysmodules/pm/source/manager.c index a3cff9a..8cd07cb 100644 --- a/sysmodules/pm/source/manager.c +++ b/sysmodules/pm/source/manager.c @@ -49,7 +49,7 @@ Result UnregisterProcess(u64 titleId) ProcessData *foundProcess = NULL; ProcessList_Lock(&g_manager.processList); - foundProcess = ProcessList_FindProcessByTitleId(&g_manager.processList, titleId); + foundProcess = ProcessList_FindProcessByTitleId(&g_manager.processList, titleId & ~N3DS_TID_MASK); if (foundProcess != NULL) { if (foundProcess == g_manager.runningApplicationData) { g_manager.runningApplicationData = NULL; From c913de1e67d70802687bf5851a2e7f5a52a024d4 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Wed, 3 Jul 2019 22:19:38 +0200 Subject: [PATCH 3/3] Fix layeredfs, fix #1280 #1275 #1262 & others --- sysmodules/loader/source/patcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysmodules/loader/source/patcher.c b/sysmodules/loader/source/patcher.c index 9e13cc0..119ee3f 100644 --- a/sysmodules/loader/source/patcher.c +++ b/sysmodules/loader/source/patcher.c @@ -536,7 +536,7 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize, romfsRedirPatchFsMountArchive = 0x100000 + fsMountArchive; romfsRedirPatchFsRegisterArchive = 0x100000 + fsRegisterArchive; romfsRedirPatchArchiveId = archiveId; - memcpy(&romfsRedirPatchRomFsMount, updateRomFsMounts[updateRomFsIndex], 4); + memcpy(&romfsRedirPatchUpdateRomFsMount, updateRomFsMounts[updateRomFsIndex], 4); memcpy(payload, romfsRedirPatch, romfsRedirPatchSize);