Crates.io | plastic |
lib.rs | plastic |
version | |
source | src |
created_at | 2024-10-19 07:08:06.235236 |
updated_at | 2024-11-12 14:00:36.098766 |
description | A NES emulator with GUI and TUI |
homepage | |
repository | https://github.com/Amjad50/plastic |
max_upload_size | |
id | 1415137 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
NES emulator in Rust
plastic is a NES emulator built from scratch using Rust.
This is a personal project for fun and to experience emulating hardware and connecting them together.
For linux, this project depends on alsa
and libudev
, you can install them using:
# Debian/Ubuntu
sudo apt install libasound2-dev libudev-dev
# Arch
sudo pacman -S alsa-lib systemd-libs
You can install the latest version of plastic or plastic_tui using cargo:
cargo install plastic
cargo install plastic_tui
If you are using Debian/Ubuntu, you can directly install the .deb
package from here
unzip plastic.deb.zip
sudo dpkg -i plastic_*.deb # will have the version in the name
If you are using Arch Linux, plastic
is available in the official repositories:
pacman -S plastic
pacman -S plastic_tui
If you want to experience the latest development version, you can build Plastic
yourself.
For example:
cargo run --release
The main emulator is at plastic_core
And its a struct NES
, where the UI would clock it, and then
take the resulting audio and pixel buffers to handle them.
We have 2 UIs, one main and the other just for fun.
Simple ui built with egui
This is just for fun, but it is actually working way better than I expected. Check the full demo.
If you have one of these terminals mentioned in this docs
Then you will have a much better experience, since these terminals support detecting button Release
, normally other terminals don't have this feature, so
the input for this UI can be a bit wonky.
I used gilrs for gamepad support and its working very nicely, keyboard on the other hand is not very responsive, so it is advised to use gamepad. Also since this uses one character for each pixel, it is advised to use the smallest font size your terminal emulator supports. Have fun.
The gamepad support is for both UIs.
In all the UI providers I followed the same controlling scheme,
as well as the ability to reset through <CTRL-R>
:
keyboard | nes controller |
---|---|
J | B |
K | A |
U | Select |
I | Start |
W | Up |
S | Down |
A | Left |
D | Right |
gamepad (PS4) | nes controller |
---|---|
X | B |
O | A |
Select | Select |
Start | Start |
Button Up | Up |
Button Down | Down |
Button Left | Left |
Button Right | Right |
For now its static, and there is no way to change it except for doing it in the code, TODO later.
This project is under MIT license.
NES is a product and/or trademark of Nintendo Co., Ltd. Nintendo Co., Ltd. and is not affiliated in any way with Plastic or its author
Most of the documentation for NES components can be found in the NES dev wiki
For the CPU(6502), this has the instruction set, and I used Klaus2m5's tests for testing the CPU alone without the other NES components.