How zallaxdev/emerald-3ds works
Emerald 3DS is a native Nintendo 3DS port of Pokémon Emerald, with a separate builder that creates game data from a user-provided ROM. The play workflow runs the game on the top screen while bottom-screen touch controls, settings, and status support the adventure; optional voxel rendering, enhanced battles, lighting, and wireless play extend it. The builder validates and processes ROM data into a playable build, with optional follower assets. Relationships among runtime modules are limited where source excerpts do not show their callers; feature and builder links use README statements where noted.
Main entry points: 3ds_game_full.c Game loop · recipe.py Build recipe · 3ds_bottom_ui.c Touch interface · ctr_voxel.c Voxel renderer
Components 21
Game runtime
- Game loop
3ds_port/src/3ds_game_full.c - 3DS platform
3ds_port/src/3ds_platform.c - Video output
3ds_port/src/3ds_video.c
Screens and input
- Touch interface
3ds_port/src/3ds_bottom_ui.c - Input handling
3ds_port/src/3ds_input.c - Field view
3ds_port/src/3ds_field_view.c - Battle HUD
3ds_port/src/3ds_battle_hud.c
World rendering
- Voxel renderer
3ds_port/src/voxel/ctr_voxel.c - Voxel geometry
3ds_port/src/voxel/voxel_mesh_builder.c - Voxel world data
3ds_port/src/voxel/voxel_world.c
ROM builder
- User ROM
- ROM processing
builder/emerald3ds_builder/rom.py - Build recipe
builder/emerald3ds_builder/recipe.py - Voxel data rebuild
builder/emerald3ds_builder/precompiled.py - Asset packaging
builder/emerald3ds_builder/pak.py - Follower assets
builder/emerald3ds_builder/followers.py - Playable build
Game extensions
- Day/night clock
3ds_port/src/3ds_daynight.c - Local wireless
3ds_port/src/3ds_rfu_adapter.c - Gameplay options
3ds_port/src/3ds_extras.c
Other components
- Player
Connections 21
- Player → Game loop: plays
- Player → Touch interface: touches
- Game loop → 3DS platform: runs on
- Game loop → Video output: renders through
- Game loop → Touch interface: shows interface
3ds_port/src/3ds_bottom_ui.c - Touch interface → Input handling: reads touch
3ds_port/src/3ds_bottom_ui.c - Game loop → Field view: shows overworld
- Game loop → Battle HUD: draws battles
- Game loop → Voxel renderer: renders optionally
- Voxel renderer → Voxel geometry: builds geometry
3ds_port/src/voxel/ctr_voxel.c - Voxel geometry → Voxel world data: uses world data
- Game loop → Day/night clock: supports lighting
- Game loop → Local wireless: supports link play
- Game loop → Gameplay options: applies options
- Player → User ROM: provides
- User ROM → ROM processing: processes
- ROM processing → Build recipe: builds recipe
- Build recipe → Voxel data rebuild: rebuilds voxel data
builder/emerald3ds_builder/precompiled.py - Build recipe → Asset packaging: packages assets
- Build recipe → Follower assets: may fetch assets
- Build recipe → Playable build: produces