From 1f7ec4be9bf86f26d57555f7fd6b43851557e47d Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 27 Aug 2016 01:04:26 -0700 Subject: Auto-detect original shared_font.bin memory base This allows a file dumped from either an o3DS or a n3DS (and potentially even an original unrebased file) to be used. --- src/core/hle/service/apt/apt.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/core/hle/service/apt/apt.cpp') diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index c009e6c98..4f4ee75cd 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -81,13 +81,8 @@ void GetSharedFont(Service::Interface* self) { // The shared font has to be relocated to the new address before being passed to the application. VAddr target_address = Memory::PhysicalToVirtualAddress(shared_font_mem->linear_heap_phys_address); - // The shared font dumped by 3dsutils (https://github.com/citra-emu/3dsutils) uses this address as base, - // so we relocate it from there to our real address. - // TODO(Subv): This address is wrong if the shared font is dumped from a n3DS, - // we need a way to automatically calculate the original address of the font from the file. - static const VAddr SHARED_FONT_VADDR = 0x18000000; if (!shared_font_relocated) { - BCFNT::RelocateSharedFont(shared_font_mem, SHARED_FONT_VADDR, target_address); + BCFNT::RelocateSharedFont(shared_font_mem, target_address); shared_font_relocated = true; } cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2); -- cgit v1.2.3