From 1525c66de74a798ccfe93d095d6718ce2a260a56 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 15 Nov 2020 22:39:39 -0800 Subject: [PATCH] git subrepo clone --force --branch=develop https://github.com/m4xw/emummc subrepo: subdir: "emummc" merged: "24bdbec8" upstream: origin: "https://github.com/m4xw/emummc" branch: "develop" commit: "24bdbec8" git-subrepo: version: "0.4.1" origin: "???" commit: "???" --- emummc/.gitrepo | 6 +++--- emummc/source/main.c | 6 +++--- emummc/source/utils/util.c | 2 ++ emummc/tools/kip1converter.py | 3 +-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/emummc/.gitrepo b/emummc/.gitrepo index 427b1d33e..deab5806f 100644 --- a/emummc/.gitrepo +++ b/emummc/.gitrepo @@ -5,8 +5,8 @@ ; [subrepo] remote = https://github.com/m4xw/emuMMC - branch = exo2 - commit = 6a814ebbe72cf5245b863b9edea9cd3801437a12 - parent = f551ca4461a79908c37307db10cd8cacf8b98f17 + branch = develop + commit = 24bdbec869be2d29d3769a3e88a76d389d094bd5 + parent = f72b21d665657b27d8de41729a6416982a79fff3 method = rebase cmdver = 0.4.1 diff --git a/emummc/source/main.c b/emummc/source/main.c index 8ec63f8d4..0e6a9dae4 100644 --- a/emummc/source/main.c +++ b/emummc/source/main.c @@ -155,8 +155,8 @@ void __initheap(void) static void _receive_process_handle_thread(void *_session_handle) { Result rc; - // Convert the argument to a handle we can use. - Handle session_handle = (Handle)(uintptr_t)_session_handle; + // Convert the argument to a handle copy we can use. + Handle session_handle = *(Handle*)_session_handle; // Receive the request from the client thread. memset(armGetTls(), 0, 0x10); @@ -194,7 +194,7 @@ static void _init_process_handle(void) { // Create a new thread to receive our handle. Handle thread_handle; - rc = svcCreateThread(&thread_handle, _receive_process_handle_thread, (void *)(uintptr_t)server_handle, temp_thread_stack + sizeof(temp_thread_stack), 0x20, 3); + rc = svcCreateThread(&thread_handle, _receive_process_handle_thread, &server_handle, temp_thread_stack + sizeof(temp_thread_stack), 0x20, 3); if (rc != 0) { fatal_abort(Fatal_BadResult); diff --git a/emummc/source/utils/util.c b/emummc/source/utils/util.c index 01c96ae34..7caffdeb8 100644 --- a/emummc/source/utils/util.c +++ b/emummc/source/utils/util.c @@ -38,6 +38,7 @@ static inline uintptr_t _GetIoMapping(u64 io_addr, u64 io_size) u64 vaddr; u64 aligned_addr = (io_addr & ~0xFFFul); u64 aligned_size = io_size + (io_addr - aligned_addr); + if (emuMMC_ctx.fs_ver >= FS_VER_10_0_0) { u64 out_size; if (svcQueryIoMapping(&vaddr, &out_size, aligned_addr, aligned_size) != 0) { @@ -48,6 +49,7 @@ static inline uintptr_t _GetIoMapping(u64 io_addr, u64 io_size) fatal_abort(Fatal_IoMappingLegacy); } } + return (uintptr_t)(vaddr + (io_addr - aligned_addr)); } diff --git a/emummc/tools/kip1converter.py b/emummc/tools/kip1converter.py index 471e1e4af..79b20154d 100644 --- a/emummc/tools/kip1converter.py +++ b/emummc/tools/kip1converter.py @@ -18,8 +18,7 @@ for i in range(6): if i < len(section_names): section["Name"] = section_names[i] - section["OutOffset"], section["DecompressedSize"], section["CompressedSize"], section["Attribute"] = unpack( - "IIII", section_bytes) + section["OutOffset"], section["DecompressedSize"], section["CompressedSize"], section["Attribute"] = unpack("IIII", section_bytes) sections.append(section) print(section)