Home

Awesome

hnes

Build Status

Welcome to hnes. hnes is a NES emulator written in Haskell.

Screenshots

<p float="left"> <img src="screenshots/nestest-4.png" width="200" /> <img src="screenshots/mario-1.png" width="200" /> <img src="screenshots/mario-2.png" width="200" /> <img src="screenshots/megaman-3.png" width="200" /> <img src="screenshots/contra-1.png" width="200" /> <img src="screenshots/contra-2.png" width="200" /> <img src="screenshots/marble-madness-2.png" width="200" /> <img src="screenshots/paperboy2-2.png" width="200" /> </p>

Mapper support

The following mappers are supported:

Lots of games run, but more don't. You can see which roms are compatible here: http://tuxnes.sourceforge.net/nesmapper.txt The best games seem to be MMC3, so that is a priority.

Mappers are basically custom memory modules that exist on the cartridges themselves, that allow referencing more memory than the NES originally shipped with. Sometimes they even do computation. A very clever idea, but a nightmare to emulate, since each mapper has to be emulated as well

Controls

NintendoEmulator
Up, Down, Left, RightArrow Keys
StartEnter
SelectSpace
AZ
BX

Building

Get Stack for building Haskell projects.

Windows instructions:

$ stack exec -- pacman -Sy mingw-w64-x86_64-pkg-config mingw-w64-x86_64-SDL2
$ stack build

OS X instructions:

$ brew install sdl2
$ stack build

Ubuntu Linux instructions:

$ sudo apt-get install libsdl2-dev
$ stack build

FreeBSD instructions:

$ pkg install sdl2
$ stack build

Running

To run:

stack exec -- hnes roms/tests/cpu/nestest/nestest.nes

Task list

Tests

There's a small test suite that is used to check for CPU and PPU accuracy. They use test roms rather than hand coding tests.

Just run stack test:

<img src="screenshots/tests.png" width="200" />

Known issues.

There are so many, where do I even begin.