applets-host (2026-10-27, cloud, Linux): generic firmware applet host and the applet stub rows¶
Branch claude/applets-host-2026-10-27; assignment orchestrations/applets-host.md. Status: tested on Linux, unbuilt on macOS.
What changed¶
- Early hook (own commit, pushed first):
libapplet_register_handler(uint32_t id, LibAppletHandler)inapplet_lib_core.h(+libapplet_find_handler,libapplet_clear_handlers,libapplet_dispatch,libapplet_call_set_out);ILibraryAppletAccessor::Startconsults the registry before the built-in answers. applets-rare builds on it. - Generic firmware host:
libapplet_program_fortable (applet id → firmware program id),libapplet_firmware_enabledpolicy. Decision: only the Mii Maker (0x12) runs from firmware by default (that path is verified); swkbd 0x11, controller 0x0C, error 0x0E and player select 0x10 are opt-in (NAPPLE_FIRMWARE_APPLET_IDS,NAPPLE_FIRMWARE_APPLETS=all) because their HLE answers are the verified ones for games and the firmware versions are unverified; HLE is the fallback when the firmware is absent. - Interactive channel: host side stores/queues (
iin<N>.binto the applet,iout<N>.binback), applet side (applet_ae.c)PopInteractiveInData,PushInteractiveOutData, the pop events; multi-storage output queue;GetResultreturns the exit result (SetTerminateResultis kept and written toresult.txt). - swkbd inline: background modes keep the keyboard running; requests (Calc, Finalize, dictionaries) are answered through
applet_swkbd_inline_request(portable). Command / reply numbers are from libnx as remembered [unverified]. - controller: honours min/max and the connected pads (already), plus the result field and cancel (
NAPPLE_CONTROLLER_SUPPORT=cancel|strict). player select: several profiles throughapplet_set_profile_lister(the account service registers it; not done here,accis not mine) and cancel. error:applet_set_error_hook(null default → the generic alert). - Stub rows 84 → 10: sleep lock + event, fatal section, window visibility, foreground rights, GPU time slice, auto sleep override, screenshot identity, request-to-display, illuminance (sensor absent until
NAPPLE_ILLUMINANCE), multimedia error, suspended ticks + event, album user data, region, capture image slots (frame source hook, black when none), game play recording flags, copyright frame buffer, three system events withapplet_signal_*hooks,RequestExit/Terminate/NeedsToExitProcess/PresetLibraryAppletGpuTimeSliceZero/RequestForAppletToGetForeground,TerminateAllLibraryApplets/AreAnyLibraryAppletsLeft(live accessor list),PushExtraStorage; appletAE: interactive rows, caller / main identity, storage id, launch reason, terminate result, in-memory theme storage,hid:sys306. - Kept stubs (10):
IsSystemBufferSharingEnabled,GetSystemSharedLayerHandle(no system compositor),PopLaunchParameter(only the preselected-account parameter exists),EnsureSaveData,GetSaveDataSize(data lives in fs.c),GetPreviousProgramIndex(no program switching),NotifyMessageToHomeMenuForDebug×2 (no home menu),miiimgroot andnfc:sys/nfp:sysroot (catch-all objects; Mii / NFC areas).
Verified vs not¶
- tested (Linux,
runtime/tests/linux/run_applet.sh):test_svc_applet67,test_svc_applet_libs163,test_svc_applet_host518 (success + cancel for swkbd/controller/player select/error, inline keyboard, firmware table with theNAPPLE_APPLET_EXEstand-in for ids 0x11 0x0C 0x0E 0x10 0x12 including interactive in/out, the former stub rows, handler registry),test_svc_applet_ae52 checks;check_known_calls.pypasses (380 rows). - unbuilt on macOS: everything above; the real firmware swkbd/controller/error/player select runs are not done (no firmware here).
- proposed: command layouts marked [unverified] (capture image rows,
GetCurrentIlluminanceEx, inline keyboard commands/replies, firmware program ids of 0x0A-0x1A except 0x12).
Files¶
runtime/src/services/applet.c, applet_ae.c, applet_core.[ch], applet_lib_core.[ch]; tests test_svc_applet_host.c, test_svc_applet_ae.c (new), test_svc_applet_libs.c; tests/linux/run_applet.sh + applet_stubs.c (Linux runner for the applet tests); docs/architecture/runtime-services.md (appended).