mirror of
https://github.com/azahar-emu/azahar.git
synced 2025-04-28 13:47:59 +03:00
Use common open source font on CHN/KOR/TWN (#920)
This commit is contained in:
parent
8dcef46a11
commit
8acc5e22a0
2 changed files with 20 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2014 Citra Emulator Project
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
@ -133,6 +133,9 @@ ResultVal<std::unique_ptr<FileBackend>> NCCHArchive::OpenFile(const Path& path,
|
||||||
constexpr u32 region_manifest = 0x00010402;
|
constexpr u32 region_manifest = 0x00010402;
|
||||||
constexpr u32 ng_word_list = 0x00010302;
|
constexpr u32 ng_word_list = 0x00010302;
|
||||||
constexpr u32 shared_font = 0x00014002;
|
constexpr u32 shared_font = 0x00014002;
|
||||||
|
constexpr u32 shared_font_CHN = 0x00014102;
|
||||||
|
constexpr u32 shared_font_KOR = 0x00014202;
|
||||||
|
constexpr u32 shared_font_TWN = 0x00014302;
|
||||||
|
|
||||||
u32 high = static_cast<u32>(title_id >> 32);
|
u32 high = static_cast<u32>(title_id >> 32);
|
||||||
u32 low = static_cast<u32>(title_id & 0xFFFFFFFF);
|
u32 low = static_cast<u32>(title_id & 0xFFFFFFFF);
|
||||||
|
@ -158,6 +161,11 @@ ResultVal<std::unique_ptr<FileBackend>> NCCHArchive::OpenFile(const Path& path,
|
||||||
"Shared Font file missing. Loading open source replacement from memory");
|
"Shared Font file missing. Loading open source replacement from memory");
|
||||||
archive_data =
|
archive_data =
|
||||||
std::vector<u8>(std::begin(SHARED_FONT_DATA), std::end(SHARED_FONT_DATA));
|
std::vector<u8>(std::begin(SHARED_FONT_DATA), std::end(SHARED_FONT_DATA));
|
||||||
|
} else if (low == shared_font_CHN || low == shared_font_KOR || low == shared_font_TWN) {
|
||||||
|
LOG_ERROR(Service_FS, "CHN/KOR/TWN shared font file missing. Loading open source "
|
||||||
|
"replacement, but text will not display properly");
|
||||||
|
archive_data =
|
||||||
|
std::vector<u8>(std::begin(SHARED_FONT_DATA), std::end(SHARED_FONT_DATA));
|
||||||
}
|
}
|
||||||
} else if (high == system_data_archive) {
|
} else if (high == system_data_archive) {
|
||||||
if (low == ng_word_list) {
|
if (low == ng_word_list) {
|
||||||
|
|
|
@ -229,10 +229,18 @@ bool Module::LoadSharedFont() {
|
||||||
|
|
||||||
const char16_t* file_name[4] = {u"cbf_std.bcfnt.lz", u"cbf_zh-Hans-CN.bcfnt.lz",
|
const char16_t* file_name[4] = {u"cbf_std.bcfnt.lz", u"cbf_zh-Hans-CN.bcfnt.lz",
|
||||||
u"cbf_ko-Hang-KR.bcfnt.lz", u"cbf_zh-Hant-TW.bcfnt.lz"};
|
u"cbf_ko-Hang-KR.bcfnt.lz", u"cbf_zh-Hant-TW.bcfnt.lz"};
|
||||||
const RomFS::RomFSFile font_file =
|
RomFS::RomFSFile font_file =
|
||||||
RomFS::GetFile(romfs_buffer.data(), {file_name[font_region_code - 1]});
|
RomFS::GetFile(romfs_buffer.data(), {file_name[font_region_code - 1]});
|
||||||
if (font_file.Data() == nullptr)
|
if (font_file.Data() == nullptr) {
|
||||||
return false;
|
if (font_region_code != 1) {
|
||||||
|
font_file = RomFS::GetFile(romfs_buffer.data(), {file_name[0]});
|
||||||
|
if (font_file.Data() == nullptr) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
u32_le status;
|
u32_le status;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue