-
-
Notifications
You must be signed in to change notification settings - Fork 0
Libretro Core
The rustynes-libretro crate provides a cycle-accurate NES emulation core for the RetroArch ecosystem. It integrates RustyNES's 100% AccuracyCoin core natively into any frontend supporting the libretro API.
-
Cycle-Accurate Emulation: Fully integrated with
rustynes-core, maintaining lockstep PPU/CPU timing. - Dynamic Audio Sync: Accurate 44.1kHz audio sampling matching the RustyNES native stream.
-
Save States & Rollback: Deterministic snapshotting (
on_serialize/on_unserialize) and memory mappers for robust save states, rollback netplay, and run-ahead. -
RetroAchievements Compatibility: Exposed WRAM, VRAM, and SRAM hooks enable full integration with RetroAchievements (
get_memory_dataandget_memory_size). - Direct Memory Mapping: Direct integration bypassing opaque binds to support advanced RetroArch features safely.
The libretro core acts as an API bridge:
-
RustyNesLibretroStruct: Manages initialization and cleanup, wrapping a safe instance ofNes. -
on_run: Executesnes.run_frame(), fetching input via RetroArch's Joypad API and pushing video output toVideoContext. -
Video Buffer: Overcomes Libretro's
XRGB8888pixel format endianness by translating the core's nativeRGBA8output linearly without allocation overhead (swaps R and B channels).
The core uses a dedicated Makefile to target standard cross-compilation endpoints natively:
cd crates/rustynes-libretro
makeThe output will be the shared library appropriate for your platform (rustynes_libretro.so, rustynes_libretro.dylib, or rustynes_libretro.dll).
RustyNES is integrated into the upstream libretro buildbots.
To push new features or metadata updates upstream to libretro-super or docs:
-
Re-fork: Always fork fresh from upstream
master. -
Clone & Branch:
git checkout -b update-rustynes-recipe -
Commit: Modify recipes/docs with strict alphabetical ordering (e.g., in
recipes/apple/crates.conf). - Pull Request: Open a PR directly to upstream.
- Delete Fork: Delete the fork after successful merge to maintain a clean workspace.
See docs/libretro/UPSTREAM_SYNC.md for complete details.
RustyNES is a cycle-accurate Nintendo Entertainment System emulator written in pure Rust. Licensed under MIT OR Apache-2.0. | GitHub Repository | Web Demo