• Stars
    star
    520
  • Rank 84,720 (Top 2 %)
  • Language
    C
  • Created almost 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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/7 games.

Screenshots

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. Needs a compiler with the case range extension, so gcc or clang probably.

$ 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 21 in the source code. The following table shows which numbers map to which keyboard keys:

number default key NES button
27 X A Button
29 Z B Button
43 Tab Select Button
40 Return Start Button
79 Arrow Right DPAD Right
80 Arrow Left DPAD Left
81 Arrow Down DPAD Down
82 Arrow Up DPAD Up

Replace the numbers on this line with one from the SDL scancode list.

More Repositories

1

pokegb

A gameboy emulator that only plays Pokemon Blue, in ~50 lines of c++.
C++
1,256
star
2

binjgb

Gameboy emulator implemented in C, that also runs in the browser
C
483
star
3

raw-wasm

Raw WebAssembly demos
WebAssembly
387
star
4

wasm-clang

Running Clang/LLD in WebAssembly Demo
JavaScript
191
star
5

love-nacl

Port of LÖVE to Native Client
C
43
star
6

wasm-e2e

Temporary scaffolding for running WebAssembly end-to-end, from C++ to browsers.
Python
23
star
7

porklike.gb

Gameboy Port of LazyDevs' Porklike
C
22
star
8

doomfirewasm

Doom fire effect, implemented in WebAssembly
HTML
20
star
9

smoothnacl

SmoothLife ported to NaCl
C++
18
star
10

lupica

Very WIP Casio Loopy emulator
C
12
star
11

nacl-nxengine

A port of nxengine to Native Client
C
9
star
12

raytrace-wasm

Mini raytracer in hand-written wasm
WebAssembly
8
star
13

metaball-wasm

WebAssembly metaball effect
WebAssembly
6
star
14

binji.github.io

HTML
5
star
15

binjnes

NES emulator implemented in C, that also runs in the browser
SourcePawn
4
star
16

pnacl.c

PNaCl reader/parser/interpreter in C
C
4
star
17

naclbind.js

JavaScript -> Native Client binding library
JavaScript
4
star
18

pnacl.js

JavaScript
3
star
19

spec.js

JavaScript implementation of the WebAssembly spec
JavaScript
3
star
20

nacl-sdk-gn-experiment

Experimenting with using GN to build the NaCl SDK
Shell
2
star
21

drod-nacl

Port of DROD: Gunthro and the Epic Blunder to NaCl
C++
2
star
22

pexe.py

Python
2
star
23

naclports

clone of https://chromium.googlesource.com/external/naclports.git
C
2
star
24

gabby

experimental clock-edge-ticked gb emulator
C++
2
star
25

gapi-nacl

Google Client APIs for Native Client
Python
2
star
26

pajama

JavaScript
2
star
27

virgil-chip8

chip8 simulator in virgil
Shell
2
star
28

bitmix

Mixing 4-/8-/16-bit values using only multiply/and/shift
JavaScript
2
star
29

mooneye-gb-tests

Cloned and filtered the tests directory from https://github.com/Gekkio/mooneye-gb
Assembly
1
star
30

wasmsummit2021-talk

Slides for my WebAssembly Summit 2021 Talk
JavaScript
1
star
31

sexpr-wasm

sexpression -> wasm
1
star
32

vimrc

Vim Script
1
star
33

ninja-wrap

Simple Python wrapper for ninja
Python
1
star
34

simfun

C++
1
star
35

drod

Mirror of Deadly Rooms of Death, (from http://drod.cvs.sourceforge.net/viewvc/drod/Caravel/?view=tar)
C++
1
star
36

fullstackfest-talk

Slides to the talk I gave at FullStackFest 2016
JavaScript
1
star
37

lucius

Clone of old lucius.vim colorscheme.
Vim Script
1
star
38

gotosthlm-talk

Slides to the talk I gave at GOTO Stockholm 2017
JavaScript
1
star
39

wasi-sdk-bin

C++
1
star