diff options
author | Ta180m | 2020-05-18 11:37:33 -0500 |
---|---|---|
committer | Ta180m | 2020-05-18 11:37:33 -0500 |
commit | d45c4c28d0a6e45eac2f11dfd61cbf0b0bf7b048 (patch) | |
tree | 0a4b2c6956108fe07f01ce641a1f0b132d9c9177 | |
parent | 4004f2b1bbeb5daed559bbda8627f697f6a39601 (diff) |
Compiling for Windowsv1.0
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | main.cpp | 1 |
3 files changed, 23 insertions, 3 deletions
@@ -5,4 +5,5 @@ roms *.nes build LaiNES -.vscode
\ No newline at end of file +.vscode +*.exe
\ No newline at end of file @@ -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 @@ -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; |