From 2be2826b0b36588b6d1725833ff29f3efed9c9c9 Mon Sep 17 00:00:00 2001 From: LiquidFenrir Date: Sat, 16 Dec 2017 04:14:21 +0100 Subject: [PATCH] detect jumping address and change mode accordingly --- sysmodules/rosalina/source/menus/process_list.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sysmodules/rosalina/source/menus/process_list.c b/sysmodules/rosalina/source/menus/process_list.c index ece7a47..cda9a01 100644 --- a/sysmodules/rosalina/source/menus/process_list.c +++ b/sysmodules/rosalina/source/menus/process_list.c @@ -324,8 +324,17 @@ static void ProcessListMenu_MemoryViewer(const ProcessInfo *info) void finishJumping(void) { - gotoAddress -= __builtin_bswap32((u32)menus[MENU_MODE_NORMAL].buf); - menus[MENU_MODE_NORMAL].selected = __builtin_bswap32(gotoAddress); // The data is edited in reverse, so it needs to be swapped before usage + gotoAddress = __builtin_bswap32(gotoAddress); // The data is edited in reverse, so it needs to be swapped before usage + + u32 codeEndAddress = codeStartAddress + codeTotalSize; + u32 heapEndAddress = heapStartAddress + heapTotalSize; + if(gotoAddress >= codeStartAddress && gotoAddress < codeEndAddress) + viewCode(); + else if(gotoAddress >= heapStartAddress && gotoAddress < heapEndAddress) + viewHeap(); + + gotoAddress -= (u32)menus[MENU_MODE_NORMAL].buf; + menus[MENU_MODE_NORMAL].selected = gotoAddress; menus[MENU_MODE_NORMAL].starti = totalRows; }