- Notifications
You must be signed in to change notification settings - Fork50
An NES emulator written in Rust
License
Apache-2.0, MIT licenses found
Licenses found
koute/pinky
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Pinky is anNES emulator written inRust completely from scratchbased only onpublicly available documentation.
You canrun it in your Web browser!
- Accurate-ish (cycle accurate) 6502, PPU and APU emulation.
- A testsuite based on test ROMs.
- A PPU testsuite automatically generated from a transistor-levelsimulation of a real PPU.
- Supports NROM (0), MMC1 (1), UxROM (2), AxROM (7) and UNROM 512 (30) mappers.
- Can be compiled as alibretro core.
- Can be compiled into WebAssembly.
There are still many things missing, including:
- Most unofficial 6502 instructions.
- Support for other mappers.
- Accurate PPU sprite overflow.
- Savestate support.
- PAL support.
Currently this isnot a production quality emulator, thoughwhatever games it can play (due to limited mapper support) it canplay quite well (e.g. such games as Super Mario Brothers, Donkey Kongor Tetris; you can check outnesmapper.txt which will tell youwhich game use which mapper).
Internally this project is split into multiple crates.
Thepinky-libretro
contains the libretro core of this emulator,which is the intended way to run it. It should be compatible withany libretro frontend, but it was only tested withRetroArch.
To compile the libretro core go into thepinky-libretro
directoryand type:
cargo build
This should build a shared object intarget/debug
calledlibpinky_libretro.so
(on non-Linux systems the extension might be different, e.g. on Windows it'll be a.dll
)which then you can use with RetroArch like this:
retroarch -L libpinky_libretro.so your_rom.nes
You can also runcargo build --release
to build a significantly better optimizedversion (the debug build should run full speed on modern systems though).
There's also a simple standalone SDL2-based frontend in thepinky-devui
directory; running it is just a matter of passing it a path to your game ROMon the command line.
Thenes-testsuite
contains an emulator agnostic testsuite of NES roms,which could be easily hooked to any other emulator simply by implementinga single trait (seenes/src/testsuite.rs
).
Therp2c02-testsuite
contains a PPU testsuite which is autogeneratedwith the help ofVisual2C02, which is a transistor-level simulatorof an actual NES PPU.
Thenes
contains the emulator itself.mos6502
has the 6502 interpreter,which could be useful for emulating other 6502-based machines.
Because why not? Writing a game console emulator is one of the most fun andrewarding projects out there, and nothing can compare with the feeling ofbeating one of your favorite games on an emulator you've wrote yourself.
The choice of NES is also an obvious one - it's the least time consumingconsole to emulate simply due to the fact that it's extremely well documented.
About
An NES emulator written in Rust