| Crates.io | switchbrew_bevy |
| lib.rs | switchbrew_bevy |
| version | 0.2.0 |
| created_at | 2025-11-29 02:33:53.490177+00 |
| updated_at | 2025-11-29 02:33:53.490177+00 |
| description | A crate to help port Bevy games to Nintendo Switch using emulators |
| homepage | |
| repository | https://github.com/ibrahimcesar/bevy-switch |
| max_upload_size | |
| id | 1956295 |
| size | 175,208 |
A Rust crate to help port Bevy games to Nintendo Switch using emulators - no NDAs required.
As noted in the Bevy Cheatbook:
The Rust Programming Language aims to make Nintendo Switch a supported target, but that work is in its early days and has not progressed enough to be useful for Bevy yet. It should be possible to work on Nintendo Switch support in the open, without NDAs, using emulators.
This crate aims to bridge that gap by providing:
Highly experimental. The aarch64-nintendo-switch-freestanding target is Tier 3 in Rust, meaning:
Add to your Cargo.toml:
[dependencies]
switchbrew_bevy = { git = "https://github.com/ibrahimcesar/bevy-switch" }
use bevy::prelude::*;
use switchbrew_bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(switch_window("My Game")),
..default()
}))
.add_plugins(SwitchPlugin)
.add_systems(Update, handle_input)
.run();
}
fn handle_input(switch_input: Res<SwitchInput>) {
// Unified input from keyboard, gamepad, or Joy-Cons
let movement = switch_input.movement();
if switch_input.just_pressed(SwitchButton::A) {
// Handle A button (or mapped keyboard key)
}
}
desktop (default) - Build for desktop development/testingswitch - Build for Nintendo Switch targetswitchbrew_bevy/
├── src/
│ ├── lib.rs # Main plugin and prelude
│ ├── platform.rs # Platform detection & config
│ ├── input.rs # Joy-Con input abstractions
│ └── window.rs # Display management
├── examples/
│ └── crab_crossing.rs # Demo game
└── ...
# Run Crab Crossing demo
cargo run --example crab_crossing
| Switch | Keyboard | Action |
|---|---|---|
| Left Stick | WASD / IJKL | Movement |
| D-Pad | Arrow Keys | Movement |
| A | X | Confirm |
| B | Z | Cancel |
| L/R | Q/W | Shoulders |
| ZL/ZR | 1/2 | Triggers |
| + | Enter | Start/Plus |
| - | Backspace | Select/Minus |
# Nightly required for build-std
rustup default nightly
rustup component add rust-src
# Optional: cargo-nx for Switch builds
cargo install cargo-nx --git https://github.com/aarch64-switch-rs/cargo-nx
Since Yuzu and Ryujinx were shut down by Nintendo in 2024, use community forks:
SwitchPluginMain plugin - adds input handling, window management, and platform detection.
SwitchInputResource for unified input across keyboard/gamepad:
movement() - Get movement vector from stick or D-padpressed(button) / just_pressed(button) - Check button stateleft_stick / right_stick - Raw stick positionsSwitchConfigResource for platform configuration:
platform - Current platform (Desktop/SwitchDocked/SwitchHandheld)resolution - Target resolutiondisplay_mode - Docked/Handheld/TabletopSwitchButtonEnum mapping all Joy-Con buttons with keyboard equivalents.
no_std compatibility (see docs/NO_STD_ANALYSIS.md)no_std StatusGood news! As of Bevy 0.16 (April 2025), many core crates support no_std:
| Status | Crates |
|---|---|
| ✅ Ready | bevy_ecs, bevy_app, bevy_math, bevy_input, bevy_transform, bevy_color, bevy_state, bevy_time, bevy_hierarchy, bevy_reflect |
| ❌ Not Planned | bevy_render, bevy_audio, bevy_asset, bevy_winit (platform-specific) |
This means game logic using ECS can run on Switch! But rendering/audio need custom backends.
See docs/NO_STD_ANALYSIS.md for full analysis.
Switch uses NVN (NVIDIA proprietary) or OpenGL ES. Bevy uses wgpu (Vulkan/Metal/DX12/WebGPU). A custom backend would be needed.
Switch target is freestanding. As of Bevy 0.16+, core ECS is no_std compatible! Rendering still requires std.
Switch has its own audio subsystem requiring a custom Bevy backend.
This project is for educational purposes. It uses only open-source tools and does not require Nintendo NDAs or proprietary SDKs.
MIT