https://github.com/binji/smolnes
NES emulator in <5000 bytes of C
https://github.com/binji/smolnes
c emulator nes nes-emu nes-emulator nintendo obfuscated
Last synced: 15 days ago
JSON representation
NES emulator in <5000 bytes of C
- Host: GitHub
- URL: https://github.com/binji/smolnes
- Owner: binji
- License: mit
- Created: 2022-10-28T15:51:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-11T08:55:55.000Z (6 months ago)
- Last Synced: 2025-03-31T19:09:58.115Z (22 days ago)
- Topics: c, emulator, nes, nes-emu, nes-emulator, nintendo, obfuscated
- Language: C
- Homepage:
- Size: 12.6 MB
- Stars: 648
- Watchers: 10
- Forks: 33
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 19 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](https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_scancode.h).