GitHub - binji/smolnes: NES emulator in <5000 bytes of C++
source link: https://github.com/binji/smolnes
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
smolnes
A NES emulator in ~5000 significant bytes of c++.
Features
Plays some mapper 0 and mapper 1 games.
Screenshots
Building
Probably only builds on Linux and macOS.
$ 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 lines 23 and 24 in the source code. The following table shows which numbers map to which keyboard keys:
number | default key | gameboy 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.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK