diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm.cpp | 20 | ||||
-rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 2 | ||||
-rw-r--r-- | src/core/memory.cpp | 25 |
4 files changed, 35 insertions, 13 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index f8c7f0efd..e825c0526 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp @@ -141,6 +141,7 @@ std::unique_ptr<Dynarmic::A64::Jit> ARM_Dynarmic::MakeJit(Common::PageTable& pag config.page_table = reinterpret_cast<void**>(page_table.pointers.data()); config.page_table_address_space_bits = address_space_bits; config.silently_mirror_page_table = false; + config.absolute_offset_page_table = true; // Multi-process state config.processor_id = core_index; diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 2e53b3221..767158444 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -9,6 +9,7 @@ #include "core/hle/kernel/writable_event.h" #include "core/hle/service/nifm/nifm.h" #include "core/hle/service/service.h" +#include "core/settings.h" namespace Service::NIFM { @@ -86,7 +87,12 @@ private: IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.PushEnum(RequestState::Connected); + + if (Settings::values.bcat_backend == "none") { + rb.PushEnum(RequestState::NotSubmitted); + } else { + rb.PushEnum(RequestState::Connected); + } } void GetResult(Kernel::HLERequestContext& ctx) { @@ -194,14 +200,22 @@ private: IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push<u8>(1); + if (Settings::values.bcat_backend == "none") { + rb.Push<u8>(0); + } else { + rb.Push<u8>(1); + } } void IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NIFM, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push<u8>(1); + if (Settings::values.bcat_backend == "none") { + rb.Push<u8>(0); + } else { + rb.Push<u8>(1); + } } Core::System& system; }; diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index a58ea9c59..62752e419 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -198,7 +198,7 @@ void NVFlinger::Compose() { const auto& igbp_buffer = buffer->get().igbp_buffer; - const auto& gpu = system.GPU(); + auto& gpu = system.GPU(); const auto& multi_fence = buffer->get().multi_fence; for (u32 fence_id = 0; fence_id < multi_fence.num_fences; fence_id++) { const auto& fence = multi_fence.fences[fence_id]; diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 91bf07a92..3c2a29d9b 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -146,7 +146,7 @@ struct Memory::Impl { u8* GetPointer(const VAddr vaddr) { u8* const page_pointer = current_page_table->pointers[vaddr >> PAGE_BITS]; if (page_pointer != nullptr) { - return page_pointer + (vaddr & PAGE_MASK); + return page_pointer + vaddr; } if (current_page_table->attributes[vaddr >> PAGE_BITS] == @@ -229,7 +229,8 @@ struct Memory::Impl { case Common::PageType::Memory: { DEBUG_ASSERT(page_table.pointers[page_index]); - const u8* const src_ptr = page_table.pointers[page_index] + page_offset; + const u8* const src_ptr = + page_table.pointers[page_index] + page_offset + (page_index << PAGE_BITS); std::memcpy(dest_buffer, src_ptr, copy_amount); break; } @@ -276,7 +277,8 @@ struct Memory::Impl { case Common::PageType::Memory: { DEBUG_ASSERT(page_table.pointers[page_index]); - u8* const dest_ptr = page_table.pointers[page_index] + page_offset; + u8* const dest_ptr = + page_table.pointers[page_index] + page_offset + (page_index << PAGE_BITS); std::memcpy(dest_ptr, src_buffer, copy_amount); break; } @@ -322,7 +324,8 @@ struct Memory::Impl { case Common::PageType::Memory: { DEBUG_ASSERT(page_table.pointers[page_index]); - u8* dest_ptr = page_table.pointers[page_index] + page_offset; + u8* dest_ptr = + page_table.pointers[page_index] + page_offset + (page_index << PAGE_BITS); std::memset(dest_ptr, 0, copy_amount); break; } @@ -368,7 +371,8 @@ struct Memory::Impl { } case Common::PageType::Memory: { DEBUG_ASSERT(page_table.pointers[page_index]); - const u8* src_ptr = page_table.pointers[page_index] + page_offset; + const u8* src_ptr = + page_table.pointers[page_index] + page_offset + (page_index << PAGE_BITS); WriteBlock(process, dest_addr, src_ptr, copy_amount); break; } @@ -446,7 +450,8 @@ struct Memory::Impl { page_type = Common::PageType::Unmapped; } else { page_type = Common::PageType::Memory; - current_page_table->pointers[vaddr >> PAGE_BITS] = pointer; + current_page_table->pointers[vaddr >> PAGE_BITS] = + pointer - (vaddr & ~PAGE_MASK); } break; } @@ -493,7 +498,9 @@ struct Memory::Impl { memory); } else { while (base != end) { - page_table.pointers[base] = memory; + page_table.pointers[base] = memory - (base << PAGE_BITS); + ASSERT_MSG(page_table.pointers[base], + "memory mapping base yield a nullptr within the table"); base += 1; memory += PAGE_SIZE; @@ -518,7 +525,7 @@ struct Memory::Impl { if (page_pointer != nullptr) { // NOTE: Avoid adding any extra logic to this fast-path block T value; - std::memcpy(&value, &page_pointer[vaddr & PAGE_MASK], sizeof(T)); + std::memcpy(&value, &page_pointer[vaddr], sizeof(T)); return value; } @@ -559,7 +566,7 @@ struct Memory::Impl { u8* const page_pointer = current_page_table->pointers[vaddr >> PAGE_BITS]; if (page_pointer != nullptr) { // NOTE: Avoid adding any extra logic to this fast-path block - std::memcpy(&page_pointer[vaddr & PAGE_MASK], &data, sizeof(T)); + std::memcpy(&page_pointer[vaddr], &data, sizeof(T)); return; } |