I have started a new post to explain how to use my port of the Nintendo Entertainment System to the iCEBreaker.
On the hardware side you will need the VGA Pmod from Diigilent or an equivalent. They are widely available and quite cheap. You can make your own with a resistor ladder. They have 12-bit color resolution.
Until the Controller/Audio Pmod is produced, you will need to connect a controller and a speaker to Pmod 2 (the head Pmod).
You will need a shift register Nintendo controller for the NES or SNES. The Nintendo original controllers have 7 pins, but there are clone controllers that also work and they typically have a 9-pin DB9 connector. Note that the controllers for the recent NES Classic mini are i2c controllers and will not work.
The pinout is described on the Nes Dev Wiki.
You should connect CLK (joy_clock) to pin 1 (FPGA pin 27), OUT (joy_strobe) to pin 2 (25) and D0 (joy_data) to pin 3 (21).
You should connect the speaker to pin 4 (FPGA pin 19).
You can use headphones or a small battery-powered speaker.
Ideally you should connect the speaker with a series resistor and a low-pass filter:
e.g. 470 ohm eg. 10uF
AUDIO_O ---./\/\/\.---o------| |-------> "Analog" output
|
---
--- eg. 0.1uF
|
|
--- GND
-
But I connect it directly without any of this. There is some risk of damaging the FPGA pin doing that, but I have never had a problem. If you are worried, at least use a series resistor.
On the software side, you should do:
git clone https://github.com/lawrie/up5k-demos
cd up5k-demos/nes
make prog
You also need a rom loaded in flash memory. The Upduino version allowed up to 8 games selected by buttons, but I am currently just supporting a single game.
I downloaded games from this site, but there are many other sites.
Only fairly small games with128kb or less of PRG ROMs and 8kb or less of CHR RAM (or 64kb PRG ROM and 64KB CHR ROM) work. The ones that worked for me were Tetris, Super Mario Bros, Contra and The Legend of Zelda.
To load a rom, you do
cd rom
./nes2bin.py <game>.nes games.bin
iceprog -o1024k games.bin
The game should start playing. You can press the user button to restart it.
Have fun