How devkitpro/libctru works
libctru is a low-level user-mode library for Nintendo 3DS homebrew, providing C/C++ programs with OS and hardware capabilities rather than a higher-level application framework. A typical workflow is that a homebrew program calls libctru APIs, which reach platform services or syscalls to perform work such as file access, networking, graphics, audio, or applet interaction. The graph groups the library’s main capability areas and shows only relationships supported by the README or supplied excerpts; several broad service areas are represented by their existing source directories because their implementations were not sampled.
Main entry points: 3ds.h Public API · fs.c Filesystem services · ndsp.c DSP audio · svc.h Kernel syscalls
Components 17
Runtime and kernel
- Public API
libctru/include/3ds.h - C runtime syscalls
libctru/source/system/syscalls.c - OS abstractions
libctru/include/3ds/os.h - Kernel syscalls
libctru/include/3ds/svc.h - Threads and sync
libctru/source/thread.c - Memory allocators
libctru/source/allocator - Utility functions
libctru/source/util
Storage and networking
- Filesystem services
libctru/source/services/fs.c - Archive devices
libctru/source/archive_dev.c - RomFS devices
libctru/source/romfs_dev.c - Sockets and networking
libctru/source/services/soc
Graphics and audio
- GPU and shaders
libctru/source/gpu - Graphics and display
libctru/source/gfx.c - DSP audio
libctru/source/ndsp/ndsp.c
System capabilities
- System applets
libctru/source/applets - Platform services
libctru/source/services
Other components
- Homebrew program
Connections 14
- Homebrew program → Public API: calls APIs
- Public API → Filesystem services: exposes access
- Public API → Sockets and networking: exposes access
- Public API → Graphics and display: exposes access
- Public API → DSP audio: exposes access
- Public API → System applets: exposes access
- Archive devices → Filesystem services: calls
libctru/source/archive_dev.c - Filesystem services → Kernel syscalls: sends requests
libctru/source/services/fs.c - C runtime syscalls → OS abstractions: reads time
libctru/source/system/syscalls.c - OS abstractions → Kernel syscalls: includes
libctru/include/3ds/os.h - DSP audio → Filesystem services: loads component
libctru/source/ndsp/ndsp.c - DSP audio → Platform services: reads settings
libctru/source/ndsp/ndsp.c - Sockets and networking → Kernel syscalls: sends requests
libctru/source/services/soc/soc_getaddrinfo.c - C runtime syscalls → Threads and sync: joins threads
libctru/source/system/syscalls.c