Code Monkey home page Code Monkey logo

nestang's Introduction

NESTang - FPGA NES with Sipeed Tang Nano 20K and Primer 20K Boards

NESTang is an open source project to recreate the Nintendo Entertainment System (NES) with modern affordable FPGA boards including Sipeed Tang Nano 20K and Primer 20K. The main logic comes from fpganes, to which I have added SDRAM/DDR3 and HDMI interfaces, among other features.

Main features,

  • HDMI output with a resolution of 720p and sound capabilities.
  • Cycle accurate gameplay quality has been achieved since the NES circuits have been almost entirely replicated.
  • Game loading via MicroSD cards (for Tang Nano 20K only) or Windows/Linux loader program.
  • Playstation 2 controller interface (for Tang Nano 20K only) or interfacing with controllers connected through a PC.

Setup for Tang Nano 20K

The best way to experience NESTang is with the Tang Nano 20K (Retro Game Kit version), which cost $38 last time I checked. The board features FPGA-friendly SDRAM memory. And the kit includes the necessary controller adapters and a pair of controllers. Here's what you need to run NESTang:

  • The Tang Nano 20K board.
  • Sipeed ps2 controller adapters connected to the board's pin 15-20 on both sides.
  • Playstation controllers (wired or wireless) connected to the adapters.
  • HDMI cable to connect the board to a monitor.
  • NESTang 0.5 program downloaded from github and transferred to the board using either openFPGALoader or Gowin programmer.
  • A MicroSD card to hold ROMs. An 8GB cards should suffice. The tools/nes2img.py python program can be used to convert .nes ROM files to an .img file. Ensure that you have Python version 3.7 or higher, and then install the Pillow package using pip3 install pillow. You can then use an SD imaging tool such as Balena Etcher to burn the newly created image onto the MicroSD card.
  • Insert the MicroSD card and power up the board to start playing your favorite games!

Setup for Tang Primer 20K

If you own a Tang Primer 20K board, you can also run NESTang. The following components are required:

  • Sipeed Tang Primer 20K board
  • Muse-Lab HDMI PMod if you got the "lite" version of Tang board. You can purchase it from aliexpress or taobao. The "dock" version of the board already has an HDMI port, so there is no need for this component. The wiring instructions for the "lite" version can be found in the doc/wiring.md file.

Follow the instructions below:

  • Download NESTang 0.4 since later versions only support Tang Nano 20K.
  • Launch the Gowin Programmer application and program either the nestang-lite.fs or nestang-dock.fs file, depending on your specific board. If your setup is correctly configured, a colorful NES palette should be displayed.
  • Connect your game controller/controllers to your PC. I use a pair of old Xbox 360 controllers.
  • Use the command loader.exe -c COM4 games\rom.nes (replace COM4 with your port number) to load the game rom.nes. If the game does not load, install Microsoft Visual C++ Redistributable package to resolve any missing DLL errors.
  • Press the left button (LB) to open the in-game OSD menu, from where you can load other games located in the games directory.
  • If the game does not load, run loader.exe -r game.nes to generate error messages from the core.

Congratulations! Now you can enjoy all your favorite NES games. For version 0.4, a Linux loader program is also available. See Linux loader for details.

Development

If you want to generate the bitstream from source, see Build Instructions.

Quite some time was spent on getting a low-latency (90ns) DDR3 controller to work for Tang Primer 20K. You may find that useful too.

Next steps

See NESTang changes.md.

Here are what I may work on when I get time. No promise though. Suggestions and pull requests are welcome!

  • Support more games.
  • An enclosure?
  • Cheats support.
  • Saves and loads.

Special Thanks

nand2mario (nand2mario at outlook.com)

Since 2022.9

nestang's People

Contributors

nand2mario avatar chandler-kluser avatar

Stargazers

Damiano Di Pietro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.