diff --git a/emulators/citra-mmj.yml b/emulators/citra-mmj.yml index a9458d166..06a196d9c 100644 --- a/emulators/citra-mmj.yml +++ b/emulators/citra-mmj.yml @@ -129,7 +129,7 @@ files: system: nintendo-3ds required: false hle_fallback: true - region: [japan, north-america, europe, oceania] + region: [japan, north-america, latin-america, europe, oceania] description: "shared font system archive, title 0x0004009b00014002" note: "First step of the shared font chain, holding cbf_std.bcfnt.lz in its RomFS. This title low ID is the one the embedded open-source font answers." source_ref: "src/core/hle/service/apt/apt.cpp:124-182, src/core/file_sys/archive_ncch.cpp:143-148" @@ -178,7 +178,7 @@ files: required: false bundled: true hle_fallback: true - region: [japan, north-america, europe, oceania] + region: [japan, north-america, latin-america, europe, oceania] description: "shared font for JPN, USA, EUR and AUS" note: "Read to offset 0x80 of the shared memory block, so the file is a bare uncompressed BCFNT. Selected for every CFG region other than CHN, KOR and TWN. The embedded open-source font answers the archive request first, so this file is only reached when that archive path is taken out." source_ref: "src/core/hle/service/apt/apt.cpp:184-228, src/core/file_sys/archive_ncch.cpp:143-148" diff --git a/tests/test_region.py b/tests/test_region.py index 1699c0894..22c5624a7 100644 --- a/tests/test_region.py +++ b/tests/test_region.py @@ -1411,5 +1411,32 @@ class MachineModelRomsCarryNoTerritory(unittest.TestCase): ) +class UsaRegionServesTheAmericas(unittest.TestCase): + """A code that knows a USA region and no Latin America one selects the + USA file there: Citra's shared font for CFG USA is 0x00014002 + (apt.cpp:128-140), and a --region br,cn pack dropped it for the Chinese + archive alone.""" + + PROFILE = Path(__file__).resolve().parents[1] / "emulators" / "citra-mmj.yml" + FONT = ( + "nand/00000000000000000000000000000000/title/0004009b/00014002/" + "content/00000000.app.romfs" + ) + + def test_brazil_ranks_the_default_shared_font(self): + import yaml + + profile = yaml.safe_load(self.PROFILE.read_text(encoding="utf-8")) + index = region.build_region_index({"citra-mmj": profile}) + requested = region.parse_requested("br,cn") + for destination, name in ( + (self.FONT, "00000000.app.romfs"), + ("sysdata/cbf_std.bcfnt", "cbf_std.bcfnt"), + ): + with self.subTest(file=destination): + regions = region.lookup_regions(index, destination, name) + self.assertEqual(region.rank(regions, requested), 0) + + if __name__ == "__main__": unittest.main()