Overview
The services module emulates Nintendo Switch system services using thenn namespace. It provides 160+ services that games use for graphics, audio, input, networking, and system functions.
ServiceTrait
Core trait that all system services must implement.Definition
Mutable reference to the global system state
Implementation
Each service implements this trait to initialize its state:System State
The global system state that holds all service instances and GPU state.Structure
Container for all 160+ service instances
GPU emulation state (see GPU Module)
Methods
new()
Create a new system state with default values.Services Container
TheServices struct holds optional instances of all 160 system services.
Structure
Option<T> because services are initialized on-demand.
Service Macro
Services are defined using thedefine_service! macro for boilerplate reduction.
Macro Definition
Usage
Define all services in one macro invocation:Service Initialization
start_host_services()
Initialize all system services.System state to initialize services into
run() method:
Available Services
Oboromi emulates 160 Nintendo Switch system services:Graphics & Display (7 services)
Graphics & Display (7 services)
vi- Visual/Display interfacevi2- Visual interface v2nvdrv- NVIDIA drivernvdrvdbg- NVIDIA driver debugnvdbg- NVIDIA debugnvgem- NVIDIA GEM memory managernvmemp- NVIDIA memory profiler
Audio (11 services)
Audio (11 services)
audout- Audio outputaudin- Audio inputaudren- Audio rendereraudrec- Audio recorderaudctl- Audio controlauddev- Audio deviceauddebug- Audio debugauddmg- Audio damage (DRC)audsmx- Audio submixaud- Audio basehwopus- Hardware Opus codec
Input (4 services)
Input (4 services)
hid- Human Interface Devicehidbus- HID busirs- Infrared sensorahid- Abstract HID
Filesystem (4 services)
Filesystem (4 services)
fsp_srv- Filesystem servicefsp_ldr- Filesystem loaderfsp_pr- Filesystem PRfs- Filesystem base
Network (12 services)
Network (12 services)
nifm- Network interface managerbsd- BSD socketsbsdcfg- BSD configurationsfdnsres- DNS resolverldn- Local wirelesslp2p- Local P2Peth- Ethernetethc- Ethernet controlwlan- Wireless LANnsd- Network service discoverydns- DNS clienthtc/htcs- Host target communication
System Services (30+ services)
System Services (30+ services)
acc- Account managementpctl- Parental controlsset- Settingspm- Process managerldr- Loaderro- Runtime object linkerfatal- Fatal error handlertime- Time servicespsm- Power state managerapm- Application power managementpcv- Power control voltageclkrst- Clock/reset control- And many more…
Complete Service List (160 total)
Complete Service List (160 total)
acc, adraw, ahid, aoc, apm, applet_ae, applet_oe, arp, aud, audctl, auddebug, auddev, auddmg, audin, audout, audrec, audren, audsmx, avm, banana, batlog, bcat, bgtc, bpc, bpmpmr, bsd, bsdcfg, bt, btdrv, btm, btp, capmtp, caps, caps2, cec_mgr, chat, clkrst, codecctl, csrng, dauth, disp, dispdrv, dmnt, dns, dt, ectx, erpt, es, eth, ethc, eupld, fan, fatal, fgm, file_io, friend, fs, fsp_ldr, fsp_pr, fsp_srv, gds, gpio, gpuk, grc, gsv, hdcp, hid, hidbus, host1x, hshl, htc, htcs, hwopus, i2c, idle, ifcfg, imf, ins, irs, jit, lbl, ldn, ldr, led, lm, lp2p, lr, manu, mig, mii, miiimg, mm, mnpp, ncm, nd, ndd, ndrm, news, nfc, nfp, ngc, ngct, nifm, nim, notif, npns, ns, nsd, ntc, nvdbg, nvdrv, nvdrvdbg, nvgem, nvmemp, olsc, omm, ommdisp, ovln, pcie, pcm, pctl, pcv, pdm, pgl, pinmux, pl, pm, prepo, psc, psm, pwm, rgltr, ro, rtc, sasbus, set, sf_uds, sfdnsres, spbg, spi, spl, sprof, spsm, srepo, ssl, syncpt, tc, tcap, time, tma_log, tmagent, ts, tspm, uart, usb, vi, vi2, vic, wlan, xcd
Implementing a Custom Service
To add functionality to an existing service or create a new one:Complete Example
Initializing and Using Services
Initializing and Using Services
Custom Service with State
Custom Service with State
Architecture
The service system follows Nintendo’s IPC (Inter-Process Communication) model:Currently, all services run in the same process. Future versions may implement true IPC for better isolation.
See Also
- CPU Module - Execute game code that calls services
- GPU Module - Used by
nvdrvandviservices - Filesystem Module - Used by
fsp_srvservice - System Architecture - How services integrate with the emulator
