aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTa180m2020-05-18 11:37:33 -0500
committerTa180m2020-05-18 11:37:33 -0500
commitd45c4c28d0a6e45eac2f11dfd61cbf0b0bf7b048 (patch)
tree0a4b2c6956108fe07f01ce641a1f0b132d9c9177
parent4004f2b1bbeb5daed559bbda8627f697f6a39601 (diff)
Compiling for Windowsv1.0
-rw-r--r--.gitignore3
-rw-r--r--README.md22
-rw-r--r--main.cpp1
3 files changed, 23 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index c1b59e2..53b7718 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,5 @@ roms
*.nes
build
LaiNES
-.vscode \ No newline at end of file
+.vscode
+*.exe \ No newline at end of file
diff --git a/README.md b/README.md
index 65c5289..1803b16 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
EMULATOR
```
-A nearly complete NES emulator in only 700 lines of C++, based on [LaiNES](https://github.com/AndreaOrru/LaiNES).
+A nearly complete NES emulator in a single 700-line C++ source file, based on [LaiNES](https://github.com/AndreaOrru/LaiNES).
```
cloc main.cpp
@@ -33,11 +33,18 @@ C++ 1 5 85 708
- SDL2
## Building
+### *nix systems
```sh
git clone --recursive https://github.com/Ta180m/BadNES && cd BadNES
g++ main.cpp -o badnes -std=c++11 -lSDL2main -lSDL2
```
+### 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
+```
+
## Usage
```sh
./badnes [path to rom]
@@ -54,5 +61,18 @@ BadNES implements the most common mappers, which should be enough for a good per
You can check the compatibility for each ROM in the following list:
http://tuxnes.sourceforge.net/nesmapper.txt
+## FAQ
+### Why the name?
+http://www.usaco.org/index.php?page=viewproblem2&cpid=1041
+
+### Why did you do this?
+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.
+
+### There's no sound!
+I'm working on it right now.
+
+### What do you mean by "nearly complete"?
+I will declare it complete once I finish implementing the APU, savestates, and maybe Mapper 7.
+
## Credits
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. \ No newline at end of file
diff --git a/main.cpp b/main.cpp
index f7a6044..1ba7550 100644
--- a/main.cpp
+++ b/main.cpp
@@ -757,7 +757,6 @@ namespace GUI {
}
// Get the joypad state from SDL
u8 get_joypad_state(int n) {
- const int DEAD_ZONE = 8000;
u8 j = 0;
j |= keys[KEY_A] << 0; j |= keys[KEY_B] << 1; j |= keys[KEY_SELECT] << 2; j |= keys[KEY_START] << 3;
j |= keys[KEY_UP] << 4; j |= keys[KEY_DOWN] << 5; j |= keys[KEY_LEFT] << 6; j |= keys[KEY_RIGHT] << 7;