This is a port of the MIST NES core to the ulx3s board using only open source tools for synthesys and place and route.
At the moment it has working DVI out (640x480@60Hz), games can be loaded from the onboard SPI flash from offset 0x200000 or from the sdcard using the esp32 OSD functionality and audio out from the 3.5mm jack
Three options are available for joystick input:
- The ulx3s onboard buttons
- An external NES gamepad
- This usb gamepad connected to us2 via usb-otg adapter
- Make sure you have ghdl and ghdl-yosys-plugin installed in addition to nextpnr and yosys.
- Type
make prog_flash
to synth and PnR the design and flash it to the ulx3s
- Follow emard's esp32 setup guide
- Upload the esp32/nes.py file from this repo to the esp32's flash root dir
- Change the esp32 main.py file to match something like this
import network
from machine import SDCard
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect("YourWifiAP", "YourPassowrd")
os.mount(SDCard(slot=3),"/sd")
import uftpd
import nes
- Add some nes ROM's to your sdcard
- Hook up your ulx3s to a monitor and press all the direction buttons on the board at the same time to bring up the file browser on the screen
- Choose your ROM and load it by pressing the right button on the board.
- If everything's right, the game should start
By default the project is built with sdcard support for loading the roms via the esp32 and joystick support using the onboard buttons and the usb gamepad connected to us2 connector.
You can also load the games from the onboard flash memory by changing the value of the parameters in the top.v file like this:
parameter C_flash_loader=1, // fujprog -j flash -f 0x200000 100in1.img
parameter C_esp32_loader=0 // usage: import nes # for OSD press together A B SELECT START or all 4 directions
and recompiling the bitstream and reflashing it to the board.
And then upload your game:
- Find and download your favorite game rom file
- Type
fujprog -j FLASH -f 0x200000 [path_to_your_game].nes
If everything went well the game should start.
If you have an original NES joypad you can use it by changing
parameter use_external_nes_joypad=1
in the top.v file and connecting it to the J1 header as follows:
J1 HEADER TOP ROW, LEFT TO RIGHT
[3.3V] [GND] [joy_data] [joy_clock] [joy_strobe]
The target ecp5 device by default is a 12K one.
If you have a ulx3s board with a bigger ecp5 FPGA, you can override it using
FPGA_SIZE=45 make prog
or changing the FPGA_SIZE
variable in the Makefile.
mapper16, mapper69, mapper83, VRC7, MapperFDS and MapperNSF.
These mappers are not supported because their source code is using system verilog features that yosys doesn't support right now.