BadNES/README.md

113 lines
3.4 KiB
Markdown
Raw Permalink Normal View History

2020-05-16 23:37:34 +00:00
```
____ _ _ _ ______ _____
| _ \ | | \ | | ____|/ ____|
| |_) | __ _ __| | \| | |__ | (___
| _ < / _` |/ _` | . ` | __| \___ \
| |_) | (_| | (_| | |\ | |____ ____) |
|____/ \__,_|\__,_|_| \_|______|_____/
2020-06-06 17:55:15 +00:00
EMULATOR
2020-05-16 23:37:34 +00:00
```
2020-05-17 02:20:01 +00:00
2020-05-19 20:12:54 +00:00
A nearly complete NES emulator in a single 750-line C++ source file, based on [LaiNES](https://github.com/AndreaOrru/LaiNES).
2020-05-18 02:59:51 +00:00
```
cloc main.cpp
1 text file.
1 unique file.
0 files ignored.
2020-05-19 20:06:15 +00:00
github.com/AlDanial/cloc v 1.74 T=0.03 s (33.6 files/s, 27684.4 lines/s)
2020-05-18 02:59:51 +00:00
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
2020-05-19 20:06:15 +00:00
C++ 1 6 60 757
2020-05-18 02:59:51 +00:00
-------------------------------------------------------------------------------
```
## Features
- Cycle accurate
2020-05-19 20:27:30 +00:00
- Savestates (Beta, expect bugs!)
- Supports Mappers 0, 1, 2, 3, 4, and 7
- Extremely minimal: only 750 lines in one source file with no dependencies
2020-05-18 02:59:51 +00:00
## Usage
2020-05-19 20:12:54 +00:00
First, head over to the release tab and grab a release. Releases marked as `beta` may be unstable!
2020-05-19 20:13:44 +00:00
If a release doesn't work, you can also build it yourself, as described below.
2020-05-18 18:32:51 +00:00
### *nix systems
2020-05-18 02:59:51 +00:00
```sh
2020-05-18 18:32:51 +00:00
./badnes [path to ROM]
2020-05-18 02:59:51 +00:00
```
2020-05-18 18:32:51 +00:00
### Windows
Drag ROM over `badnes.exe`
2020-05-19 20:06:15 +00:00
Alternatively, use
```sh
badnes.exe [path to ROM]
```
2020-05-19 20:02:32 +00:00
## Controls
2020-05-19 20:06:15 +00:00
UP - UP
DOWN - DOWN
LEFT - LEFT
RIGHT - RIGHT
A - A
B - S
START - ENTER
SELECT - SPACE
SAVE STATE - Q
LOAD STATE - W
2020-05-19 20:02:32 +00:00
2020-05-18 02:59:51 +00:00
## Compatibility
BadNES implements the most common mappers, which should be enough for a good percentage of the games:
- NROM (Mapper 000)
- MMC1 / SxROM (Mapper 001)
- UxROM (Mapper 002)
- CNROM (Mapper 003)
- MMC3, MMC6 / TxROM (Mapper 004)
2020-05-19 20:27:30 +00:00
- AxROM (Mapper 007) (Beta, expect bugs!)
2020-05-18 02:59:51 +00:00
You can check the compatibility for each ROM in the following list:
http://tuxnes.sourceforge.net/nesmapper.txt
2020-05-19 20:12:54 +00:00
## Building
### Requirements
- C++11
- SDL2
### *nix systems
```sh
git clone --recursive https://github.com/Ta180m/BadNES && cd BadNES
g++ main.cpp -o badnes -std=c++11 -lSDL2main -lSDL2 -O3
```
### Windows
```sh
git clone --recursive https://github.com/Ta180m/BadNES && cd BadNES
g++ main.cpp -o badnes -std=c++11 -IC:\mingw\include\SDL2 -LC:\mingw\lib -w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2 -O3
```
2020-05-18 16:37:33 +00:00
## FAQ
### Why the name?
http://www.usaco.org/index.php?page=viewproblem2&cpid=1041
### Why did you do this?
2020-05-18 17:25:20 +00:00
I really like LaiNES: it's very minimal and compact — but it has several dependencies, so I try to write the shortest NES emulator possible, in a single source file.
2020-05-18 16:37:33 +00:00
### There's no sound!
2020-05-19 20:27:30 +00:00
I'm working on it right now. You can also check out the `sound` branch, although it's still in a very early stage right now.
2020-05-18 16:37:33 +00:00
### What do you mean by "nearly complete"?
I'll say it's complete once I finish implementing the APU.
2020-05-18 16:37:33 +00:00
2020-05-18 19:18:48 +00:00
### This game doesn't work!
2020-05-19 20:27:30 +00:00
Check to make sure BadNES implements its mapper.
### Mapper 7 / Savestates / etc. doesn't work!
Those features are still in `beta` right now so expect bugs.
2020-05-18 19:18:48 +00:00
2020-05-18 02:59:51 +00:00
## Credits
2020-05-19 20:12:54 +00:00
Special thanks to [Andrea Orru](https://github.com/AndreaOrru) for creating [LaiNES](https://github.com/AndreaOrru/LaiNES), the emulator that this project derives much of its code from.