mkarlsson Posted October 22, 2013 Report Share Posted October 22, 2013 A while ago James1095 pointed out in the Community Project section that there is a NES-on-FPGA project with source code available on the net.http://forum.gadgetfactory.net/index.php?/topic/1754-fpga-nes/ The project is written by Brian Bennet for a Spartan6 LX16 board with analog VGA output so I decided to give the code a try by porting it to Pipistrello and the LogicStart MegaWing with the goal of getting the code to run with minimal changes. In the end only a DCM unit for doubling the Pipistrello 50 MHz clock to 100 MHz needed to be added and the ucf file needed to be changed for Pipistrello pinout. The hardest part was actually to compile the app for the PC used for downloading game ROMs to the board after the bit file is loaded (nesdbg). The app has the serial port hardwired to COM5 so the Pipistrello serial port must be renamed COM5 in order for nesdbg to work (this can be done using the device manager). Attached is a zip file with the software app for downloading game roms and two versions of the hardware - one version for using real NES joypads (connected to the top row on the PMOD connector) and one version for emulating the joypad with the joystick and the switches on the LogicStart MegaWIng. The latter version is mainly for testing since I don't have any NES controllers to play with, and a game like Super Mario Bros can actually be played with this version although the joystick is a bit hard to use. Switch 4 is "A", switch 5 is "B", switch 6 is "select" and switch 7 is "start". The four sound channels can be muted using switches 0-3. Steps:1) Add the LogicStart MegaWing to Pipistrello and hook up the VGA monitor and the sound cable to the LogicStart board2) Connect the Pipistrello/LogicStart board-set to the PC and rename the Pipistrello serial port to COM5 using the device manager.2) Unzip the fpga_nes.zip file somewhere on the PC and cd to the root folder3) Double-click on load_bitfile_emu.bat, this should download the joypad emulation bit file to Pipistrello.4) Once the bit file is downloaded the VGA monitor should come up with a white area in the center surrounded by a light-blue border.5) Next step is to double-click on run_nesdbg.bat which should get the FPGA NES Debugger up and running6) Using the File pulldown menu, select "Load ROM..." and select a rom game (located at sw\roms\game_roms\supported)7) A progress bar will show the progress of the download8) The game should start up One thing I did notice is that some of the sprites have a vertical line of missing pixels but over all it looks pretty good. Enjoy!fpga_nes.zip Link to comment Share on other sites More sharing options...
mkarlsson Posted October 22, 2013 Author Report Share Posted October 22, 2013 Shoot, it looks like you have to install Mircosoft Visual C++ Studio express 2010 to get the needed .dll's etc.http://go.microsoft.com/?linkid=9709949 Here is a (quite poor) video showing how the bit file and the game rom is downloaded:http://www.youtube.com/watch?v=SzM9pJNuk8A Link to comment Share on other sites More sharing options...
alex Posted October 22, 2013 Report Share Posted October 22, 2013 If you're talking about msvcr100d.dll this is the debug version of msvcr100.dll (note the 'd' at the end). If you compile a Release version of the program instead of Debug, most people should have the required DLL, if not they can download Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) or Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) Link to comment Share on other sites More sharing options...
mkarlsson Posted October 22, 2013 Author Report Share Posted October 22, 2013 OK, attached is a new zip file with the nesdbg app compiled for Release. fpga_nes_release.zip Link to comment Share on other sites More sharing options...
Jim Battle Posted October 23, 2013 Report Share Posted October 23, 2013 Magnus, how many slices does it occupy? Link to comment Share on other sites More sharing options...
mkarlsson Posted October 23, 2013 Author Report Share Posted October 23, 2013 The report says 2097 slices (30% of the LX45). This is for the version that uses real NES controllers. Link to comment Share on other sites More sharing options...
mkarlsson Posted October 31, 2013 Author Report Share Posted October 31, 2013 Update: Now supports video-out via HDMI, game load via SD-card, defaults to Super Mario Bros. at boot-up This is a port of the NES fpga emulation for Pipistrello LX45 originally written by Brian Bennett and modified by Magnus Karlsson.At boot-up the SD-card is checked for a game file (game.nes). If found it will load and start the game, else it will default to Super Mario Bros. which is pre-loaded in BRAM.The attached bit file can be loaded to the Pipistrello board using fpgaprog (fpgaprog -f nes_top_smb_mb.bit) Hookup:Video-out via HDMI connector (VGA resolution)Sound-out via audio connectorSupport for up to 2 NES game controllers connected to the top row of the PMOD connector.PMOD connector hookup (top, from right to left): CLOCK, LATCH, DATA OUT(1), DATA OUT(2), GND, POWER Here is a source for an inexpensive NES game controller that works:http://www.amazon.com/NES-Controller-Generic-Nintendo-Entertainment-System/dp/B000UCF9TA See attached image for NES game controller socket pinout and attached Pipistrello bit file. Enjoy!nes_top_smb_mb.bit Link to comment Share on other sites More sharing options...
Felix Posted November 12, 2013 Report Share Posted November 12, 2013 NES Original Controller Socket http://www.robotshop.com/en/nes-original-controller-socket.html Link to comment Share on other sites More sharing options...
mkarlsson Posted November 13, 2013 Author Report Share Posted November 13, 2013 I actually made a PMOD board with 2 NES controller sockets and a PS2 connector that hopefully will be available soon for sale.Here is a picture of the two boards together: Link to comment Share on other sites More sharing options...
Holguer A Becerra Posted March 8, 2014 Report Share Posted March 8, 2014 Wht if I told you that i wrote a code in python to avoid the use of Visual C++ and SP1. You can choose the serial port, and it is compatible on linux, windows and macosx Enjoy! and share.. Good job Brian Bennett Requirements:->Python 2.7-> Pyserial NES_PROGRAMMING.zip Link to comment Share on other sites More sharing options...
mkarlsson Posted March 8, 2014 Author Report Share Posted March 8, 2014 Great, I will try it out. Magnus Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.