How itsveenee/snesticleaurora works
Purpose and entry points
SNESticle Aurora is a native PlayStation 2 multi-system emulator focused on CRT-oriented 240p output and hardware-specific integration. The EE application starts at src/app/main.cpp, with application-level shell, ROM, movie, and system coordination in src/app/emushell.cpp, src/app/emurom.cpp, and src/app/emusys.cpp. Makefile is the top-level build entry point; the produced PS2 ELF runs directly on PS2 hardware.
Runtime orchestration
The PS2 main loop is decomposed into initialization, IOP setup, input, browser/menu, loading, emulation execution, rendering, persistence, and network/SMB phases. The architectural control center is src/platform/ps2/system/mainloop.cpp, split across mainloop_init.cpp, mainloop_exec.cpp, mainloop_load.cpp, and mainloop_render.cpp. This layer owns runtime transitions: boot/init → UI/browser → select media/system → load ROM/core → frame loop → return to UI.
Frontend, UI, and storage boundary
The frontend presents a console-native browser and settings UI rather than a web application. UI components include src/platform/ps2/ui/uiBrowser.cpp, src/platform/ps2/ui/uiMenu.cpp, and src/platform/ps2/ui/uiVideo.cpp. ROM selection and persistence flow through shared file/path APIs (src/common/base/file.cpp, src/common/base/path.h) to PS2 storage/media backends. Memory-card save support is isolated in src/platform/ps2/memcard/memcard.cpp; runtime loading also supports USB/MX4SIO, CD/DVD, and experimental SMB paths.
Emulator-system adapters and cores
A common frontend dispatches to system-specific ROM and core adapters:
• SNES: src/snes/core/snes.cpp, src/snes/rom/snrom.cpp, src/snes/state/snstate.cpp.
• NES/FDS: src/nes/system/nessystem.cpp, src/nes/quicknes/quicknes_bridge.cpp, src/nes/fceumm/fceumm_fds_bridge.cpp.
• Sega platforms: src/sega/system/segarom.cpp, src/sega/picodrive/picodrive_bridge.cpp.
• PC Engine: src/pce/system/pcerom.cpp, src/pce/beetle/pce_bridge.cpp.
These adapters are the compatibility boundary between Aurora’s input/video/save conventions and bundled or submodule-based third-party emulation cores. CD-capable PCE and Sega loading is intentionally constrained to .cue paths and user-provided firmware.
Frame I/O and PS2 hardware integration
Each emulation frame consumes normalized controller/mouse input, produces video surfaces and audio samples, then routes them to PS2 hardware backends. Input is implemented at src/platform/ps2/input/input.cpp; graphics target the PS2 Graphics Synthesizer through src/platform/ps2/gs/gs.c, src/platform/ps2/gs/gskit_backend.c, and common surfaces/textures in src/common/render/rendersurface.cpp. Audio mixing is shared in src/common/render/audmixbuffer.cpp and emitted through the PS2 audio service implementation src/modules/audio/audio_audsrv.c.
EE/IOP modules and external dependencies
The project spans PS2 EE application code plus IOP-resident IRX modules embedded/loaded by src/platform/ps2/system/embedded_irx.cpp and runtime IOP control in src/platform/ps2/system/mainloop_iop.cpp. Prebuilt modules in irx/ provide controller, memory-card, USB mass-storage, CD streaming, SMB, and block-device functions. Network play is a separate EE protocol stack under src/modules/netplay/netplay_ee.c and src/modules/netplay/protocol/. Major external cores are pinned Git submodules under src/third_party/, including QuickNES, FCEUmm FDS, PicoDrive, Beetle PCE Fast, and experimental Snes9x 2010.
Main entry points: mainloop.cpp Runtime state machine · rendersurface.cpp Render surfaces · snes.cpp SNES adapter and core · nessystem.cpp NES/FDS adapters
Components 21
EE Application
- Make build · Builds the PS2 ELF for hardware.
Makefile - EE entry point
src/app/main.cpp - App shell · Coordinates shell, ROM, movie, and system actions.
src/app/emushell.cpp
PS2 Runtime
- Runtime state machine · Transitions boot, UI, loading, frame execution, and return.
src/platform/ps2/system/mainloop.cpp - Loop stages · Initialization, execution, loading, and rendering are split across companion files.
src/platform/ps2/system/mainloop_init.cpp - Browser and settings UI
src/platform/ps2/ui/uiBrowser.cpp - File and path APIs
src/common/base/file.cpp - Memory-card saves
src/platform/ps2/memcard/memcard.cpp
System Adapters
- SNES adapter and core · ROM, state, and SNES core integration.
src/snes/core/snes.cpp - NES/FDS adapters · Dispatches QuickNES and FCEUmm FDS bridges.
src/nes/system/nessystem.cpp - Sega adapter · Integrates PicoDrive for Sega platforms.
src/sega/system/segarom.cpp - PC Engine adapter · Integrates Beetle PCE; CD loading requires CUE and firmware.
src/pce/system/pcerom.cpp - Pinned core submodules · Provides bundled third-party emulation cores.
Frame I/O
- Normalized input
src/platform/ps2/input/input.cpp - Render surfaces
src/common/render/rendersurface.cpp - GS video backend
src/platform/ps2/gs/gs.c - Audio mixer
src/common/render/audmixbuffer.cpp
IOP & Services
- Audio service
src/modules/audio/audio_audsrv.c - IOP control and embedded IRX · Loads embedded modules and controls IOP runtime services.
src/platform/ps2/system/embedded_irx.cpp - Prebuilt IRX modules · Controller, storage, CD, SMB, and block-device modules.
- Netplay EE stack
src/modules/netplay/netplay_ee.c
Connections 27
- Make build → EE entry point: builds
- EE entry point → App shell: starts
- App shell → Runtime state machine: drives
- Runtime state machine → Loop stages: uses
- Runtime state machine → Browser and settings UI: enters browser/menu
- Browser and settings UI → File and path APIs: browses media
- Runtime state machine → File and path APIs: loads ROMs
- Runtime state machine → Memory-card saves: loads and saves state
- Runtime state machine → SNES adapter and core: dispatches selected system
- Runtime state machine → NES/FDS adapters: dispatches selected system
- Runtime state machine → Sega adapter: dispatches selected system
- Runtime state machine → PC Engine adapter: dispatches selected system
- SNES adapter and core → Pinned core submodules: uses core dependency
- NES/FDS adapters → Pinned core submodules: uses core dependency
- Sega adapter → Pinned core submodules: uses core dependency
- PC Engine adapter → Pinned core submodules: uses core dependency
- Runtime state machine → Normalized input: consumes each frame
- SNES adapter and core → Render surfaces: produces video
- NES/FDS adapters → Render surfaces: produces video
- Sega adapter → Render surfaces: produces video
- PC Engine adapter → Render surfaces: produces video
- Render surfaces → GS video backend: presents to GS
- SNES adapter and core → Audio mixer: produces audio
- Audio mixer → Audio service: emits samples
- Runtime state machine → IOP control and embedded IRX: initializes IOP
- IOP control and embedded IRX → Prebuilt IRX modules: loads services
- Runtime state machine → Netplay EE stack: runs optional networking