How melonds-emu/melonds works
melonDS is a Nintendo DS/DSi emulator with a Qt/SDL frontend. A user selects a game and boot mode; the emulator runs CPU instructions and device behavior, then produces graphics and audio for the frontend. It also supports DSi NAND/title management, storage, and networking. The graph reflects the README and shown source-index references; several runtime modules were not sampled, so their internal calls and frontend wiring are omitted rather than assumed.
Main entry points: NDS.cpp DS System · EmuInstance.cpp Emulator Instance · ARMJIT.h ARM JIT · DSi.h DSi Devices
Components 23
Frontend
- Qt SDL Frontend
src/frontend/qt_sdl/main.cpp - Emulator Instance
src/frontend/qt_sdl/EmuInstance.cpp - Screen Output
src/frontend/qt_sdl/Screen.cpp
Emulation Core
- DS System
src/NDS.cpp - ARM CPU
src/ARM.h - ARM Interpreter
src/ARMInterpreter.cpp - ARM JIT
src/ARMJIT.h - JIT Memory
src/ARMJIT_Memory.h - JIT Emitters
src/dolphin/Arm64Emitter.h - DSP Interpreter
src/teakra/src/interpreter.h - Graphics Engine
src/GPU.h - Audio Engine
src/SPU.h
Devices and Media
- Game Cartridges
src/NDSCart.h - DSi Devices
src/DSi.h - DSi NAND
src/DSi_NAND.h - Firmware
src/SPI_Firmware.h - FAT Storage
src/FATStorage.cpp - FatFs
src/fatfs/ff.h
Runtime Services
- Platform Services
src/Platform.h - Action Replay
src/AREngine.cpp - Save States
src/Savestate.h
Connectivity
- Network Features
src/net/Netplay.cpp
Other components
- Player
Connections 23
- Player → Qt SDL Frontend: selects game
README.md - Qt SDL Frontend → Emulator Instance: starts emulation
- Emulator Instance → DS System: controls runtime
- DS System → ARM CPU: runs CPU
- DS System → ARM JIT: uses JIT
- DS System → Graphics Engine: uses graphics
- DS System → Audio Engine: uses audio
- DS System → Game Cartridges: uses cartridge
- DS System → DSi Devices: uses DSi devices
- DS System → Action Replay: runs cheats
src/AREngine.cpp - ARM CPU → ARM Interpreter: interprets instructions
- ARM JIT → JIT Memory: uses memory layer
src/ARMJIT.h - ARM JIT → JIT Emitters: emits native code
- DSi Devices → DSi NAND: uses NAND
src/DSi.h - DSi Devices → Firmware: uses firmware
src/DSi.h - DSi NAND → FatFs: uses filesystem
src/DSi_NAND.h - FAT Storage → FatFs: uses filesystem
- FAT Storage → Platform Services: accesses host files
src/FATStorage.cpp - Emulator Instance → Platform Services: uses platform services
- Graphics Engine → Screen Output: produces frames
- DS System → DSP Interpreter: uses DSP core
- Emulator Instance → Save States: manages state
- Emulator Instance → Network Features: configures networking