Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

smolnes

> 编程语言
Open source

NES emulator in <5000 bytes of C

787 stars0 likes0 views
WebsiteGitHub

About

NES emulator in <5000 bytes of C

smolnes

A NES emulator in ~5000 significant bytes of c.

Features

Plays some mapper 0/1/2/3/4/7 games.

Screenshots

Building

Probably only builds on Linux and macOS. Try gcc or clang.

$ make

Running

$ ./smolnes 

Keys:

Action Key
DPAD-UP ↑
DPAD-DOWN ↓
DPAD-LEFT ←
DPAD-RIGHT →
B Z
A X
START Enter
SELECT Tab

Updating keys

Look for line 20 in the source code. The following table shows which numbers map to which keyboard keys:

character number default key NES button
\33 27 X A Button
\35 29 Z B Button
+ 43 Tab Select Button
( 40 Return Start Button
R 82 Arrow Up DPAD Up
Q 81 Arrow Down DPAD Down
P 80 Arrow Left DPAD Left
O 79 Arrow Right DPAD Right
  1. Look up the keys you want to replace from this list SDL scancode list
  2. Convert the number to its ascii character, or C character literal.
  3. Replace this character in the string.

Projects using smolnes

  • p2r3/smolnes-nut The smolnes emulator ported to Squirrel for Portal 2 - https://youtu.be/PUTRvF7slYs
  • nevesnunes/ghidra-plays-mario Playing NES ROMs with Ghidra's PCode Emulator
  • sysprog21/rv32emu Compact and Efficient RISC-V RV32I[MAFC] emulator (uses smolnes as a demo)
  • ma.tthias.xyz/en/blog/smolnes-vuln-research/ Vulnerability Research on SmolNES

Let me know if you've used smolnes and I'll add it to the list.

Issues· 1 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ccemulatornesnes-emu

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言