HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
koute
pinky
Rust2019–2019
koute / pinky

pinky

An NES emulator written in Rust

2Distinct people
2Mentions
0Explicit recommenders
810GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

An NES emulator written in Rust

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour2 dated mentions

Observed mentions: 2019-03-19 17:24:36 UTC to 2019-03-19 18:52:23 UTC.

012019-03-19 17:00:00 UTC to 2019-03-19 18:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 19, 17:002019-03-19 18:00:00 UTC to 2019-03-19 19:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 19, 18:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Mar 19, 17:002019-03-19 17:00:00 UTC2019-03-19 18:00:00 UTC101
Mar 19, 18:002019-03-19 18:00:00 UTC2019-03-19 19:00:00 UTC101

What Hacker News says

2 sources
Shameless plug - for anyone that's interested, I also wrote a NES emulator in Rust a few years back: https://github.com/koute/pinky I even compiled it to WebAssembly: https://koute.github.io/pinky-web/ > The CPU address space has several PPU registers mapped. So the CPU maintains a permanent mutable reference to the PPU. But the top-level Nes object also owns the PPU. I worked around this using Box to assign fixed memory addresses to values, and then “unsafe” pointer dereferences when needed. There's actually a neat little trick which I used in my emulator which allows you to fulfill Rust's single ownership rule while simultaneously keeping the subcomponents of the emulator independent, making it possible to interconnect them without any unsafe and letting the compiler to optimize the whole thing as everything is statically dispatched. Ba
Read the rest
sically simplifying a little bit for each component (CPU, PPU, APU, etc.): 1. You put the whole state of the component into a separate `State` structure. 2. You create a `Context` trait which has a `get_state`/`get_state_mut` method as well as various callbacks needed by the component itself (e.g. PPU's `Context` has a `peek_video_memory` so that it can read video memory which is stored externally). 3. You create an `Interface` trait (with `Context` as supertrait) which contains the public interface of a given component (e.g. PPU has `execute`, `peek_ppustatus`, etc.). 4. You put the whole implementation of the component inside of a `Private` trait (with `Context` as supertrait). 5. You do a blanket impl of `Interface` and `Private` for any `T` which implements `Context`. So then you create a single `Nes` structure which has `cpu::State`, `ppu::State`, etc. inside of it as fields, and implements the `cpu::Context`, `ppu::Context`, etc. traits. Inside of those impls you just wire the various subcomponents together, and voila, every component is encapsulated from each other and yet they can talk with each other, and there is no indirection anywhere (no `Box`es, no `RefCell`s, etc.).
In Implementing a NES Emulator in Rust

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.