From 0d4893c4485a007f147f83128416124e7a91ef6a Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 22 Sep 2022 21:32:54 +0100 Subject: [PATCH] Cleanup font magic generation code --- app/src/main/cpp/skyline/services/pl/shared_font_core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/skyline/services/pl/shared_font_core.h b/app/src/main/cpp/skyline/services/pl/shared_font_core.h index 41a0f271..32be9864 100644 --- a/app/src/main/cpp/skyline/services/pl/shared_font_core.h +++ b/app/src/main/cpp/skyline/services/pl/shared_font_core.h @@ -40,10 +40,6 @@ namespace skyline::service::pl { auto fontsDirectory{std::make_shared(state.os->publicAppFilesPath + "fonts/")}; auto ptr{reinterpret_cast(sharedFontMemory->host.data())}; for (auto &font : fonts) { - *ptr++ = 0x18029a7f; - *ptr++ = util::SwapEndianness(font.length ^ 0x49621806); - font.offset = static_cast(reinterpret_cast(ptr) - reinterpret_cast(sharedFontMemory->host.data())); - std::shared_ptr fontFile; if (fontsDirectory->FileExists(font.path)) fontFile = fontsDirectory->OpenFile(font.path); @@ -51,6 +47,10 @@ namespace skyline::service::pl { fontFile = state.os->assetFileSystem->OpenFile("fonts/" + font.path); font.length = static_cast(fontFile->size); + + *ptr++ = util::SwapEndianness(SharedFontResult); + *ptr++ = util::SwapEndianness(font.length ^ SharedFontKey); + font.offset = static_cast(reinterpret_cast(ptr) - reinterpret_cast(sharedFontMemory->host.data())); fontFile->Read(span(reinterpret_cast(ptr), font.length)); ptr = reinterpret_cast(reinterpret_cast(ptr) + font.length); }