Repository navigation
host/pl: take over GetBuiltInFontDataSet for Switch 2 font types - #2548
Closed
FifteenPen wants to merge 1 commit into
Closed
FifteenPen wants to merge 1 commit into
FifteenPen wants to merge 1 commit into
Conversation
Kirby and the Forgotten Land's Nintendo Switch 2 Edition (program 04004D300C5AE001, v65536, SDK 21) asks for its built-in fonts at boot with nn::pl::GetBuiltInFontDataSet, the list form of GetBuiltInFontData. Unhooked, the SDK connects to pl:u, which the host does not serve, and aborts. The SDK's own version (sdk+0x4fc780 in that build) takes at most 6 types, sends them to pl:u as one byte each, then fills *count entries of 0x18 bytes in order and returns whether the service answered. The takeover fills each type as the GetBuiltInFontData takeover does, with the same stand-in fonts, in the order asked, and leaves out a type with no stand-in font. The Switch 1 overload (BuiltInFontTypeNx) is not hooked: no game at hand imports it. t_shared_font checks the entries, their order, the limit of 6 and the case with no fonts. The game reached play past frame 1800 on a Mac build of main plus seedds#1639 (Program 1 packing) and this change. services.md's entry on SDK 21's built-in fonts covers the new call.
2 of 3 tasks
seedds
added a commit
that referenced
this pull request
Nov 14, 2026
Kirby and the Forgotten Land's Nintendo Switch 2 Edition (program 04004D300C5AE001, v65536, SDK 21) asks for its built-in fonts at boot with nn::pl::GetBuiltInFontDataSet, the list form of GetBuiltInFontData. Unhooked, the SDK connects to pl:u, which the host does not serve, and aborts. The SDK's own versions (Splatoon Raiders' sdk+0x59a3c0 for Switch 2 types, sdk+0x59a720 for Switch 1 types; sdk+0x4fc780 in Kirby's) take at most 6 or 7 types, send them to pl:u as one byte each, fill *count entries of 0x18 bytes in order and return whether the fonts are loaded; a failed request aborts. The Switch 2 overload has the service write *count whatever the answer, the Switch 1 overload writes it only when the fonts are loaded. Both takeovers share one helper that fills each type as the GetBuiltInFontData takeover does, with the same stand-in fonts, in the order asked, and leaves out a type with no stand-in font. t_shared_font checks the entries, their order, both limits and the case with no fonts (146 checks). The game reached play past frame 1800 on a Mac build of main plus #1639 (Program 1 packing) and the Switch 2 overload's takeover. services.md's entry on SDK 21's built-in fonts covers both overloads. Co-authored-by: FifteenPen <354289956+FifteenPen@users.noreply.github.com>
Owner
|
Landed as f0dba3b on main, with you credited as co-author. Thanks for the clear diagnosis. Two additions on top: the SDK's disassembly (Splatoon Raiders' SDK 21, sdk+0x59a3c0) shows the return value is whether the fonts are loaded (a failed request aborts), so the comment and services.md now say that; and the Switch 1 overload (sdk+0x59a720: at most 7 types, *count set only when the fonts are loaded) is taken over too, through a helper the two share, with checks in t_shared_font (146 pass). |
Kayyluhh
added a commit
to Kayyluhh/nxnative
that referenced
this pull request
Nov 14, 2026
… types is answered by the host: Kirby and the Forgotten Land's Switch 2 Edition no longer aborts at boot connecting to pl:u
Kayyluhh
added a commit
to Kayyluhh/nxnative
that referenced
this pull request
Nov 14, 2026
…: on main in its own form as f0dba3b, both overloads
Kayyluhh
added a commit
to Kayyluhh/nxnative
that referenced
this pull request
Nov 14, 2026
…dds#2548 (both GetBuiltInFontDataSet overloads)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Symptom: Kirby and the Forgotten Land's Nintendo Switch 2 Edition (program
04004D300C5AE001, v65536, SDK 21) aborts at boot, connecting topl:u.Cause: it asks for its built-in fonts with
nn::pl::GetBuiltInFontDataSet, the list form ofGetBuiltInFontData, which the host already takes over. Unhooked, the SDK goes topl:u, which the host does not serve.What the SDK does (its own
GetBuiltInFontDataSet,sdk+0x4fc780in that build):pl:uas one byte each (an in-buffer ofnbytes).*countentries of 0x18 bytes (BuiltInFontDataOunce) in order.bool, not aResult).Change (
dm/host/hle_sdk16.c): a takeover of the Switch 2 overload.GetBuiltInFontDatatakeover fills it, with the same stand-in fonts, in the order asked.BuiltInFontTypeNx) is not hooked: no game at hand imports it.The reference entry Built-in fonts and the audio device notification of SDK 21 covers the new call. Kirby's game note links it under "Found on this game".
Checked
make -C dm/host/tests GAME=01004D300C5AE000 build/t_shared_font: 144 checks, 0 failed. The new checks cover the entries, their order, the limit of 6 and the case with no fonts.dm/tools/tests/test_docs.py: OK.04004D300C5AE001, v65536). It reached play past frame 1800 with its fonts loaded (the log's shared font lines), and no abort. The text on screen was not compared with the console.GetBuiltInFontDataSet.scripts/regress.py impactfinds 0 profiled games that use it, and the 4 with usage manifests are not affected.Docs
docs/reference/services.mdentry and Kirby's game note, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index did not change)