| Crates.io | tetanes-core |
| lib.rs | tetanes-core |
| version | 0.12.2 |
| created_at | 2024-05-16 16:43:31.765099+00 |
| updated_at | 2025-04-05 16:26:50.581312+00 |
| description | A NES Emulator written in Rust |
| homepage | https://lukeworks.tech/tetanes |
| repository | https://github.com/lukexor/tetanes.git |
| max_upload_size | |
| id | 1242277 |
| size | 6,817,859 |
📖 Summary - ✨ Features - 🚧 Building - 🚀 Getting Started - ⚠️ Known Issues - 💬 Contact

photo credit for background: Zsolt Palatinus on unsplash
This is the core emulation library for TetaNES. Savvy developers can build their
own custom emulation libraries or applications in Rust on top of tetanes-core.
Some community examples:
The current minimum Rust version is 1.85.0.
To build the project, you'll need a nightly version of the compiler and run
cargo build or cargo build --release (if you want better framerates).
Below is a basic example of setting up tetanes_core with a ROM and running the
emulation. For a more in-depth example see the tetanes::nes::emulation module.
use tetanes_core::prelude::*;
fn main() -> anyhow::Result<()> {
let mut control_deck = ControlDeck::new();
// Load a ROM from the filesystem.
// See also: `ControlDeck::load_rom` for loading anything that implements `Read`.
control_deck.load_rom_path("some_awesome_game.nes")?;
while control_deck.is_running() {
// See also: `ControlDeck::clock_frame_output` and `ControlDeck::clock_frame_into`
control_deck.clock_frame()?;
let audio_samples = control_deck.audio_samples();
// Process audio samples (e.g. by sending it to an audio device)
control_deck.clear_audio_samples();
let frame_buffer = control_deck.frame_buffer();
// Process frame buffer (e.g. by rendering it to the screen)
// If not relying on vsync, sleep or otherwise wait the remainder of the
// 16ms frame time to clock again
}
Ok(())
}
The aim is for general stability, but the version isn't 1.0 yet and there are
several large features on the roadmap that may result in breaking changes. This
applies to both APIs and save file formats.
Once some of these larger features are completed, and 1.0 is released, more
effort will be dedicatged to versioning these files for backward compatibility
in the event of future breaking changes.
See the github issue tracker.
For issue reporting, please use the github issue tracker. You can also contact me directly at https://lukeworks.tech/contact/.