MCPcopy Index your code
hub / github.com/binji/smolnes

github.com/binji/smolnes @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
13 symbols 31 edges 2 files 5 documented · 38%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

smolnes

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:

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

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

Core symbols most depended-on inside this repo

set_nz
called by 17
deobfuscated.c
n
called by 17
smolnes.c
mem
called by 14
deobfuscated.c
read_pc
called by 11
deobfuscated.c
R
called by 11
smolnes.c
Z
called by 8
smolnes.c
get_chr_byte
called by 5
deobfuscated.c
q
called by 5
smolnes.c

Shape

Function 13

Languages

C100%

Modules by API surface

smolnes.c7 symbols
deobfuscated.c6 symbols

For agents

$ claude mcp add smolnes \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact