2026-11-01 am-depth-applets (batch 2026-11-01-r3, Mac)¶
Branch claude/am-depth-applets-2026-11-01-r3. Reference fixtures and rows for the am interfaces (with five misnumbered rows fixed), the remaining
offline web document kinds, applets driven on real titles, frame-based scripted input.
1. am interfaces¶
- New switchbrew fixtures in
runtime/tests/ipc_reference/(layout facts only; read from switchbrew's "Applet Manager services" page):appletOE,IApplicationProxy,ICommonStateGetter,ISelfController,IWindowController,IAudioController,IDisplayController,ILibraryAppletCreator,ILibraryAppletAccessor,IStorageAccessor,IApplicationFunctions,IDebugFunctions. The amIStoragewas left out on purpose: its name is the fsIStoragefixture's. app_reachable= n, with the reason on a comment line, for: debug-only ids (am.debug!dev_function/ GetDebugModeFlag; the whole IDebugFunctions beyond id 0, since a retail GetDebugFunctions hands out no object), Switch 2 only ([S2]), newer than 22.x, system-applet services (home button lock accessors, migration, sleep policy, capture buffers of other applets, kiosk "ForQuest" launches), unnamed ids, and the one switchbrew marks "not usable under an Application" (PushToGeneralChannel). Everything an application API reaches is y.- Numbering bugs fixed (switchbrew and libnx agree): IApplicationFunctions InitializeApplicationCopyrightFrameBuffer / SetApplicationCopyrightImage / SetApplicationCopyrightVisibility were 91-93, now 100-102; GetPreviousProgramIndex was 110, now 123; GetGpuErrorDetectedSystemEvent was 120 (that id is ExecuteProgram: a title calling it got an event handle), now 130; GetFriendInvitationStorageChannelEvent was 130, now 140. ILibraryAppletAccessor PresetLibraryAppletGpuTimeSliceZero was 50 (SetOutOfFocusApplicationSuspendingEnabled), now 60. Name fix: ISelfController 19 is SetAlbumImageOrientation.
- 41 rows added. Real answers: BeginVrModeEx/EndVrModeEx and the VR 3D trio share the VR flag; IsInControllerFirmwareUpdateSection false; GetHdcpAuthenticationState 2 (authenticated); ExtendSaveData / CreateCacheStorage (nothing more required), Get{SaveData,DeviceSaveData}SizeMax (4 GiB / 1 GiB journal), GetCacheStorageMax (index 255, 4 GiB); CreateHandleStorage (a storage over the transfer memory, like 11); CreateLibraryApplet (20.0) = CreateLibraryAppletOld; quiet events for HDCP change, notification channel, health warning, limited license. Unavailable here (am result 0x1480): CreateApplication*AndRequestToStart, ExecuteProgram, CreateMovieMaker, GetCurrentChildLibraryApplet. Empty channels (0x680): TryPopFromFriendInvitationStorageChannel, TryPopFromNotificationStorageChannel. Preference setters are IPC_STUB no-ops.
test_ipc_reference: 111 fixtures, 1325 application-reachable ids, missing 0.
2. Offline web document kinds¶
- Legal information (kind 2): resolved under the title's extracted LegalInformation content,
<data-dir>/legalorNAPPLE_LEGAL_ROOT. napple-build does not extract that content yet (see the integrator file), so on today's data a title's legal page is still an error exit. - System data (kind 3, TLV 7 = system data id): the firmware archive
<data-dir>/../sysdata/<id>.bin(the files fs.c serves to guests), extracted once by the new portable RomFS readerweb_romfs_extractinto$TMPDIR/napple-web-sysdata/<id>/, then resolved like an offline page. The firmware's0100000000000804holds the console's legal lines (legallines.htdocs/, 60 files);0100000000000803holds the browser's error templates. - While a page is open
applet_web_html_root()reports the root it came from, so the web sheet grants the web view read access to it (the sheet code is unchanged).applet_web_open_document()opens any offline document the HOME-menu way;NAPPLE_OPEN_WEB_DOC=<secs>:<kind>:<id hex>:<path>. - Verified: SMO windowed,
NAPPLE_OPEN_WEB_DOC=25:3:0100000000000804:legallines.htdocs/index.html:web document: shown, exit reason 0, last page file:///.../napple-web-sysdata/0100000000000804/legallines.htdocs/index.html; the web sheet shows the console's trademark and open-source notice page.
3. Applets on titles¶
| Applet | Title / route | Result |
|---|---|---|
| Controller support (0x0C) | MK8D: title, A, main menu Down, A (Multiplayer), A (2 players) | verified: CreateLibraryApplet id 0xc, ControllerSupportArg 0x21c asking 2..2 players, answered; the game continues to the two-player character select |
| Software keyboard (0x11) | LAS: fresh save, L+R at the title, A on a new file (frame-timed script, below) | verified again: swkbd: entered "Frames", read back by the game |
| Error (0x0E) | MK8D: main menu, Online Play | not raised: the game opens nifm:u, and with the nifm answers it gets offline it stays on the menu without a library applet (on a console the network error UI comes from nifm's request result: nifm area). No other route found in the first minutes of the four titles |
| Player select (0x10) | ACNH / MK8D starts | not raised: both start with the preselected user (PopLaunchParameter account preselect); with one profile nothing asks. Tested only (test_svc_applet_libs) |
| Album (0x15) | none of the four titles opens it | tested only (test_svc_applet_album) |
| Web / offline web (0x13/0x17) | SMO manual (r1), SMO system data page (above) | verified (HOME-menu path) |
4. Frame-based scripted input¶
NAPPLE_INPUT_SCRIPT times and holds may be written f<n> (presented guest frames, napple_gfx_frame_count looked up at run time), or all plain numbers are
frames with NAPPLE_INPUT_SCRIPT_FRAMES=1; a frame-timed press holds 9 frames unless told otherwise. Host test test_input_script (16 checks).
Verified on LAS (118 s, fresh save): f5950:L+R:f40,f6200:A,f6380:A,f6560:A,f6740:A,f6920:A pressed at exactly frames 5950, 6200, 6380, 6560, 6740
(the log prints the frame); the third A opened the name keyboard.
Verified here (Mac)¶
| Check | Result |
|---|---|
make -C runtime GFX=napple test |
pass (ipc_reference 111 fixtures, missing 0) |
make -C runtime GFX=napple test-services |
pass (63 suites; applet 116, applet_host 539, applet_web 219 checks) |
make -C runtime test-host |
pass (input_script 16/16) |
| Four-title 60 s boots (shared games/ data) | LAS / SMO / MK8D / ACNH update+DLC: ok / ok / ok / ok (3547 / 3544 / 2828 / 1782 frames; MK8D lower than earlier rounds' ~3300 under a busier Mac, no failure) |
Files¶
runtime/src/services/applet.c, runtime/src/services/applet_web_core.{c,h}, runtime/src/input_script.c, runtime/tests/test_svc_applet.c,
runtime/tests/test_svc_applet_host.c, runtime/tests/test_svc_applet_web.c, runtime/tests/host/test_input_script.c (new),
runtime/tests/ipc_reference/{appletOE,IApplicationProxy,ICommonStateGetter,ISelfController,IWindowController,IAudioController,IDisplayController,
ILibraryAppletCreator,ILibraryAppletAccessor,IStorageAccessor,IApplicationFunctions,IDebugFunctions}.txt (new), runtime/Makefile (one host test rule),
docs/architecture/runtime-services.md (am section appended), this note.