smolnes

April 7, 2026 · View on GitHub

A NES emulator in ~5000 significant bytes of c.

Features

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

Screenshots

Batman Kirby's Adventure Mega Man 3 Little Nemo the Dream Master River City Ransom Super Mario Bros. 2 Super Mario Bros. 3 Teenage Mutant Ninja Turtles 2 Bionic Commando Donkey Kong Dragon Warrior Adventures of Lolo Legend of Zelda Metroid Mega Man 2 Ninja Gaiden Rad Racer Super Mario Bros. Teenage Mutant Ninja Turtle Contra Goonies 2 Castlevania DuckTales Alwa's Awakening Witch n' Wiz Battletoads Wizard's and Warriors II Gradius

Source Code

Building

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

$ make

Running

$ ./smolnes <rom.nes>

Keys:

ActionKey
DPAD-UP
DPAD-DOWN
DPAD-LEFT
DPAD-RIGHT
BZ
AX
STARTEnter
SELECTTab

Updating keys

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

characternumberdefault keyNES button
\3327XA Button
\3529ZB Button
+43TabSelect Button
(40ReturnStart Button
R82Arrow UpDPAD Up
Q81Arrow DownDPAD Down
P80Arrow LeftDPAD Left
O79Arrow RightDPAD 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

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