Code Monkey home page Code Monkey logo

nestang's Introduction

NESTang - NES for Sipeed Tang FPGA Boards

NESTang is an open source project to recreate the Nintendo Entertainment System (NES) with Sipeed Tang FPGA boards, including Sipeed Tang Primer 25K, Tang Nano 20K and Tang Primer 20K.

Main features,

  • 720p HDMI output with sound.
  • Cycle accurate gameplay quality has been achieved since the NES circuits have been almost entirely replicated.
  • Rom loading from MicroSD cards with an easy-to-use menu system.
  • Playstation 2 controllers support and experimental USB gamepads support.

Pick a Board

You need either the Sipeed Tang Primer 25K or Tang Nano 20K FPGA board to run the latest NESTang.

Installation

A step-by-step instructions is available for installation. Here are quick instructions for the more experienced,

  • Tang Primer 25K needs 4 modules: Tang sdram, DVI, Dualshock2, SD and a pair of dualshock controllers. Currently these should cost ~$60 in total. Tang Nano 20K just needs controller adapters. Check instructions for how to connect the modules / adapters.
  • Download a NESTang release from github. The bitstream (nestang_*.fs) should be written to flash at address 0. The firmware (firmware.bin) should be written to 0x500000 (5MB).
  • A MicroSD card to hold ROMs.
  • Connect one or two DualShock2 controllers to the DS2 pmod. Or you can connect one USB gamepad to use the experimental USB gamepad support. The board only has one USB port. So use DS2 if you want two players.
  • Insert the MicroSD card, connect an HDMI monitor or TV, and enjoy your games.

Version 0.4 also supports tang primer 20k.

Development

If you want to generate the bitstream from source, see Build Instructions. The recommended Gowin IDE version is 1.9.9 commercial (requires a free license).

Usb_hid_host was development so NESTang could support USB gamepads. Follow the link if you want to use it for your FPGA projects. It supports keyboards and mice 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!

  • Cheats support.
  • Saves and loads.

Special Thanks

nand2mario (nand2mario at outlook.com)

Since 2022.9

nestang's People

Contributors

chandler-kluser avatar fjpolo avatar nand2mario avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nestang's Issues

Can't synthesis the project.

After the command "gw_sh.exe primer25k.tcl" at the bottom of the console screen: <Error while executing "run all" (file "build.tcl" line 55)>. The same error occurs if you try to synthesize from GowinIDE. How to fix it? I'm using Windows10

UPDATE: issue burning FPGA

I have a dock and accidentally burned the lite core - and now I can't burn the dock core.

Have I fried it or his it in a state that can be reset?
When I run openFPGALoad --detect I see the board

% sudo openFPGALoader --detect                          
Jtag frequency : requested 6.00MHz   -> real 6.00MHz  
index 0:
	idcode 0x81b
	manufacturer Gowin
	family GW2A
	model  GW2A(R)-18(C)
	irlength 8

but when I attempt to load the core, I get:

% sudo openFPGALoader -b tangprimer20k -f nestang-0.4-dock.fs 
write to flash
Jtag frequency : requested 6.00MHz   -> real 6.00MHz  
Parse file Parse nestang-0.4-dock.fs: 
Done
DONE
Jtag frequency : requested 2.50MHz   -> real 2.00MHz  
Jtag frequency : requested 10.00MHz  -> real 6.00MHz  
erase SRAM Done
Detail: 
Jedec ID          : ff
memory type       : ff
memory capacity   : ff
EDID + CFD length : ff
EDID              : ffff
CFD               : 
Detail: 
Jedec ID          : ff
memory type       : ff
memory capacity   : ff
EDID + CFD length : ff
EDID              : ffff
CFD               : 
RDSR : ff
WIP  : 1
WEL  : 1
BP   : f
TB   : 1
SRWD : 1
flash chip unknown: use basic protection detection
unlock blocks
Error: block protection is set
       can't unlock without --unprotect-flash
Error: Failed to program FPGA: Error: write to flash failed

UPDATE1:

I was able to burn the dock core and get the checkered patterned color blocks up when the core runs. I've had to use an external 6V supply as I can only burn the core using openFPGALoad on OSX - Linux fails. As such, I have to switch back over to linux to run the loader - but when I run it, it detects two gamepads but doesn't respond to the controllers at all

$ sudo ./loader/loader -c /dev/ttyUSB1 games/pacman.nes.hex
pacman.nes.hex transmitted over /dev/ttyUSB1 at baudrate 921600.
Found 2 gamepads
Opening gamepad /dev/input/event16
Opening gamepad /dev/input/event17

getting closer... but no roms running ... roms run successfully in the sim

Master System controller support

I’m no coder, more of a copy & paste warrior and have no experience of FPGA, but rather then trying to implement USB would it be possible using the GPIO of the Tango nano 20k to read the digital inputs from a Sega Master System controller? From a nostalgia perspective it’s very similar to the NES controller (rectangular pad with 2 buttons) but I think easier to read as it doesn’t use Data/Latch etc but instead each pinout is a direct connection to each button, therefore, no input lag either, unlike USB or what the BlueRetro would introduce.

I hope that makes sense and is a plausible solution 🤷🏻‍♂️

Color pattern screen only with v0.4 release and nestang-lite.fs

Hello,

Thought I'd report this as a follow up to the loader issue I've had. Now I've been able to test loader from Windows as well as the Linux version using a MangoPi MQ-Quad.

Software: Debian for the Mango Pi, loader 0.4, Contra, SMB1/2/3 .nes files.

My hardware setup is a Tang 20k lite with JTAG connection and PMOD HDMI. Controller is 8bitdo dongle which is recognized as an x360 controller.

Issue: Turning on power shows the color pattern. Loading a .nes file seemingly works. Loader transfers it. But the screen still shows color pattern only. Loader also detects input. I'm able to trigger OSD with LB (according to output log). The screen still stays with the pattern. Pressing LB a few times causes the screen to go black. I can load other games in the folder randomly by blindly pressing buttons, but no game seem to load correctly.

Please advise

Thank you

[Help wanted][Testers] Multitap Four Score support

⚠ Still in ongoing development ⚠

fjpolo/TangNano20k_Multitap is a branch in development that is supposed to support the NES Four Score by adding two additional OEM controllers. I got rid of the PS2 and USB controllers, to have more IOs, so it's a OEM-only branch.

I'm looking for testers with more than one joystick (I have only one) in order to test this branch.

What to do:

  • Get the release bitstream: v20240320
  • Flash the NESTang
  • Follow the schematics here to connect all gamepad connectors
  • Load a Four-Score game, legally obtained, to the SD Card root dir, like Micro Mages
  • Start your NESTang
  • Start the game
  • Choose 3-4 players
  • Press Select+Up to enable Multitap, LED[2] should be ON
  • Test it :)

sd_file_list_reader's list_namelen is always 8'h00

I'm trying to parse a custom binary file to be used for a cheat module. To do that I wanted to detect the extension of the file inside SDLoader module to see if a cheat file is availabe for the selected ROM file. To do that, I thought about doing something like this:

               if (fn + file_start == sd_list_file) begin
                    if (FONT[sd_list_name[ch]][ny[2:0]][nx[2:0]])
                            if( 
                                sd_list_name[sd_list_namelen - 8] == "." &&
                                sd_list_name[sd_list_namelen - 7] == "c" &&
                                sd_list_name[sd_list_namelen - 6] == "h" && 
                                sd_list_name[sd_list_namelen - 5] == "e" &&
                                sd_list_name[sd_list_namelen - 4] == "a" &&
                                sd_list_name[sd_list_namelen - 3] == "t" &&
                                sd_list_name[sd_list_namelen - 2] == "e" &&
                                sd_list_name[sd_list_namelen - 1] == "x" && 
                                sd_list_name[sd_list_namelen] == "t"
                               ) begin
                                     color <= COLOR_TEXT_CHEAT;
                               end else begin
                                     color <= COLOR_TEXT;    // yellow
                               end

Test code was supposed to change text colour to gray if there's a *.cheatext file. I realised it wasn't changing any filename colour so I tried substracting 1, 2 and 3 to the indices, with the same result.

After that I tried something different, to check what sd_list_namelen actually was:

                if (fn + file_start == sd_list_file) begin
                    if (FONT[sd_list_name[ch]][ny[2:0]][nx[2:0]])
                        if(ch == sd_list_namelen) begin  
                            color <= COLOR_TEXT_CHEAT;
                        end else begin
                            color <= COLOR_TEXT;    // yellow
                        end

The result was that every first letter of every filename is being changed to gray colour, meaning that sd_list_namelen is always 8'h00. At least that's my interpretation given my results.

WhatsApp Image 2023-10-29 at 00 18 40

If there's a more direct and easy way to detect the end of the filename, or the extension, then I'd appreciate any support 🙂

loader does not work, even with redistributables

Hello

Thank you for creating this project.

Unfortunately loader.exe does not work with the linked redistributable. After installing, several are still missing, including msvcp140d.dll

A quick search on Google informs me that this is a debug version not included in any release redistributable.

Please advise

Thank you

[help needed] 2nd controller not working properly

I was playing Super Mario Bros with 2 players, utilizing the Sipeed ps2 controller adapters (Both wired on pins 15-20). The first controller works fine. With the second controller the d-pad left, B and A buttons work as expected. The d-pad up runs luigi to the right and d-pad right and down do nothing.

Contra the start button is up and the right button is right and down combined for the second player.

I did swap the controllers and the adapter boards and all work fine on the player 1, it is only player 2

I also created a wiki page on here for connecting the adapters on the breadboard (with a picture). I believe they are hooked up correctly and this is an issue with the firmware. I am using Nestang v0.5 on a Tang Nano 20k with the included ps2 controller adapters.

[help needed] Standard nes controller

Is there a way to have an alternate configuration at compile time for a standard 7 pin NES controller port to be wired to the nano20k instead of the PS2 ones that come with the kit? Besides the 5 volt and ground there are just the other 5 pins to deal with. It would make it a bit more authentic feeling.......or the homebrew analogue NT people can still purchase and afford :) . I do not know if that is a huge effort in code, but would think not (I could be wrong).

Dualshock controller, 2nd joystick bad behaviour

EDITED: This is not specific to Nestang as it is also reproduced bad behaviour of joystick 2 on my own cores.
I thing the problem are those pull-ups to 3V3 from PIN53_EDID_CLK (DCD_CLK) and PIN52_EDID_DAT (DCD_DAT).


Tested with Bubble Bobble and your binarie file.
Joystick1 works well.
Joystick 2 when it jumps it also fires. And when press up or down does right or left.

Later I've assigned the leds to the NES buttons as follows:
( D U START SELECT B A)
assign led = nes_btn2[5:0];

2 (A) led 0 and led 1 (led 1 should not lit)
3 (B) led 1 OK
Select No Led changes
Start led 3 and 4 (led 4 should not lit)
Up led 4 OK
Down led 5 OK
Other buttons:
Left led 5 (led 5 should not lit)

Another topic:

Being the Dualshock controller an SPI controller, it is using 8 GPIO pins but controlling the 2 CS lines should be enough with 5 pins. In MiSTer the PSX SNAC addon only uses 5 pins.

For the kit distributed by Sipeed it is Ok to connect the two gamepads on both sides of the tang nano 20k, but for a future carrier board I think only 5 pins would be sufficient. I'm not aware if heavy modifications on the controller should be made to allow that.

[Enhancements][Cheats] Porting from NES_MISTer

I've worked on the cheats system before and beend wanting to implement it for some time now.

Since latest release v0.9 supports a softcore and FATfs it's the right time to bring this one back. I'll work on porting it from MISTer NES core so we can enjoy some dirty cheats

References:

Cannot Flash my Sipeed Primer 20k

Since I have tried to flash my device with the new release v.0.4.0 my external flash memory is not working anymore.

I have tried to flash my second Sipeed Tang Primer 20k too, but the same thing happened. At that second time I recorded my screen to show you the output (you can download through this link)

I am not sure if the SPI flash chip has been bricked, yet.

I have tried to flash both with openFPGALoader and GoWin Official Programmer, none worked at all...

I have also compiled from source and flashed it, but it didn't work either...

The output I have got when I flashed the FPGA was:

openFPGALoader -b tangprimer20k -f nestang-0.4-lite.fs 
write to flash
Jtag frequency : requested 6.00MHz   -> real 6.00MHz  
Parse file Parse nestang-0.4-lite.fs: 
Done
DONE
Jtag frequency : requested 2.50MHz   -> real 2.00MHz  
Jtag frequency : requested 10.00MHz  -> real 6.00MHz  
erase SRAM Done
Detail: 
Jedec ID          : 0b
memory type       : 40
memory capacity   : 16
EDID + CFD length : 0b
EDID              : 1640
CFD               : 
Detail: 
Jedec ID          : 0b
memory type       : 40
memory capacity   : 16
EDID + CFD length : 0b
EDID              : 1640
CFD               : 
RDSR : 00
WIP  : 0
WEL  : 0
BP   : 0
TB   : 0
SRWD : 0
flash chip unknown: use basic protection detection
Erasing: [==================================================] 100.00%
Done
Writing: [======================                            ] 42.09%Error: ftdi_read_data in mpsse_readError: ftdiWriting: [=======================                           ] 45.51%Error: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_readError: ftdi_read_data in mpsse_read

Button combo to return back to game list?

Is there a button combo to return back to the Game List? If not can there be one added so that you do not have to power the tango on and off. Can the menu also cycle through the game list pages faster? It's a bit sluggish and with tons of games it takes a while to jump to the game you want or maybe have a menu option to jump to different letters like say jump to games that start with D.

I also got my prototype boards in and so far they are working as intended but a mistake was made with the PS2 ports where it has to be soldered on the bottom of the board vs the top but it works and will be fixed in version 2. I am waiting on an esp32 board to arrive to test Blue Retro with that and other controllers through Blue Retro.

USB ports work and only 1 of my generic usb controllers work (an N64 usb controller) every other controller I had is an Xinput controller and those do not work. Would be nice if support for that was added since many 3rd party controllers default to that mode like 8BitDo.

NESTang Front
NESTang Top
NESTang Assembled

NES file loader

Currently I have to make games.img from my NES rom files collection but this is so uncomfortable. I have about 1,000 NES files but I can't make a games.img file including my all roms(because of max letter limit for one dos command). And I have to make another games.img file if I want to delete some roms from my SD card every time. Please enhance the loader that can load *.NES rom from SD card folder after selecting from the rom list. I don't know why games.img packing needed.

Video Sync Issue

Occasionally the device will temporarily loose sync and other times completely lose video sync (requiring a reset) while everything else is still working ( I can hear audio and my characther seems to be moving by audio cues). I am using an LG C1 and have had sync issies with the Tang8k device before, although a fix was found there. The other thing I notices is that the Tang20k seems to get very hot and wondering if that could be related. I added a heatsink from a raspberrypi i had laying around to try and help there.

Softcore not loading

I boot up the device with the new update and it just displays NESTang at the bottom and nothing else
image

Suggestion: Consider Static Linking to Avoid Visual C++ Runtime Installation

Hello there,

I would like to recommend considering the usage of a statically linked version of the program to mitigate potential issues related to the installation of Visual C++ 2015* runtime. By employing static linking, we can eliminate the need for end-users to separately install the Visual C++ 2015 runtime, which can often be a source of frustration and compatibility problems.

Static linking enables us to include all necessary libraries and dependencies directly into the executable, resulting in a self-contained and portable binary. As a result, users won't have to worry about missing runtime installations or encountering conflicts with other software utilizing different versions of the Visual C++ runtime.

Though dynamic linking is commonly preferred due to smaller file sizes and easier updates, static linking can be a more robust solution, especially when targeting a broad user base with varying system configurations.

To achieve this, we could modify the build settings to link all required libraries statically. Please note that this may increase the size of the executable, but the trade-off in terms of user experience and compatibility could be well worth it.

I understand that there might be some considerations and trade-offs involved in this decision, but I believe it would greatly improve the overall usability and ease of deployment for our users.

Let's discuss this option further and weigh the pros and cons to make an informed decision that aligns with the project's goals and the best interests of our community.

Looking forward to your thoughts on this matter.

Kind regards,
Denis

segmenation fault

why do I get segmentation fault when loading the newly released 0.5, but no problem with 0.5rc

Add support for 4:3 resolution

I have one of the ipad retina display's the same use used in Laser Bear's "crt" kit and on aliepxress.

Laser Bear
aliexpress

The issue is the resolution is 2048x1536 (4:3). This results in the image being squished. Is there a way to support this resolution, or even a variable and i can compile a version for myself. In Mister, they created video_mode=13 for this.

The resolution the nestang displays on the display is 1280x720. Maybe a 1024x768 (not sure if the tang 20k can do 1600x1200).

Mister video modes

It would be a sweet setup with the nestang (and snestang) and this display.

Use the BL616/M0S for USB, file system and more

The Tang Nano 20k comes with a BL616 as a flasher. The BL616 is quite powerful and can easily handle USB host (mouse, keyboard, joysticks, mass storage) and is able to cope with fat and exfat file systems with long file names etc etc. I am using it in MiSTeryNano. Would it make sense to use it for nestang and/or snestang as well. This might even free up some resources in the FPGA.

If you don't want to re-flash the internal BL616 you could use an external M0S or the like.

Support for another VIDEO/AUDIO output

Tang Nano 20K board including 40 pins RGB connecter and stereo speaker connector but they doesn't work with NESTang. I can use HDMI outputs only. But I want to connect NESTang with my old CRT monitor using RGB(VGA D-SUB) and listen the sounds from my audio receiver. Please support them. NESTang is emulating classic NES games, so I think many users want to use OLD CRT/RGB for it.

Great job

First of all, I thank @nand2mario and @Chandler-Kluser for contributing those efforts to the NES platform.

However, there are many copied and reworked NES platforms nowadays.

For example, MAME (and many soft emulators) and MIST (using ALTERA Cyclone III), MiSTer (using ALTERA Cyclone V SOC).
It may not be so beneficial to do those tasks again.

Moreover, there are so many copied and cracked NES ASIC platforms in China. The product runs just like the original NES hardware, and does not need to redo a China FPGA platform.

I have also taken some time to do those tasks on Tang Primer (Anlogic), but have seen that it is not so useful for marketing and contributing.

Yeah, I realized FPGAs should do like its advantage: computing and real-time, flexible.

This comment does not mean giving up something, but should do better.

You could see my old project video, this project was abandoned:
https://www.youtube.com/watch?v=OIXi4LuuK1E

P.S.
Creating a game menu is a good idea, but using a python script to create a game image is not so convenient if you have no computer around...

I am so lazy, just put game1.nes, game2.nes,... game12.nes to SD card, it represents F1~F12 key respectively. Press and start. You could put those files to a SD card with your smartphone.

Outdated Verilator Build Instructions?

Hello,

Before anything else, thank you for the effort you put into building this, and for sharing this with us!!

The instructions for simulating with Verilator in the nestang/verilator folder seem to be out of date. Specifically, the build instructions reference a nes_tang20k.v file that doesn't seem to exist. Here's an excerpt from verilator/setup.sh:

ln -sf $DIR/src/mmu.v hdl
ln -sf $DIR/src/nes_tang20k.v hdl 
ln -sf $DIR/src/nes.v hdl

This (I believe) ultimately cascades into an error when I run make sim

### VERILATE ####
mkdir -p obj_dir
cd obj_dir; ln -sf ../game.nes.hex .; ln -sf ../hdl/src/*.txt .
# verilator --top-module NES_Tang20k --trace -cc -O3 -CFLAGS "-I/usr/include/SDL2 -D_REENTRANT -O3" -LDFLAGS "-lSDL2" hdl/*.v --exe sim_main.cpp
verilator --top-module NES_Tang20k -cc -O3 --exe -CFLAGS "-I/usr/include/SDL2 -D_REENTRANT -O3" -LDFLAGS "-lSDL2" hdl/*.v sim_main.cpp
%Error-PKGNODECL: hdl/memory_controller.v:12:8: Package/class 'configPackage' not found, and needs to be predeclared (IEEE 1800-2017 26.3)
   12 | import configPackage::*;
      |        ^~~~~~~~~~~~~
                  ... For error description see https://verilator.org/warn/PKGNODECL?v=5.019
%Error: hdl/memory_controller.v:12:8: Importing from missing package 'configPackage'
   12 | import configPackage::*;
      |        ^~~~~~~~~~~~~
%Error: Exiting due to 2 error(s)
        ... See the manual at https://verilator.org/verilator_doc.html for more assistance.
make: *** [Makefile:17: obj_dir/VNES_Tang20k.cpp] Error 1

I've tried replacing nes_tang20k.v with nestang_top.sv in verilator/setup.sh but that doesn't seem to work.

TIA

Cartridge slot?

Getting a 60-pin card edge connector for the Famicom is pretty easy, and I have a few. The Sipeed Tang has enough GPIOs that it should be able to handle it. Has anyone considered an option of building something like this with a proper cartridge connector and controller ports? I wouldn't be opposed to designing a PCB myself for the tang to connect into that can make full use of a new PCB designed to fit the standard Famicom motherboard footprint for original shell compatibility.

ST7789 display support and original nes controller

im trying to build a portable nes console with an original nes cotroller, need support for a st7789 display and pwn audio support with an original nes controller, my only option now is nescat but it will be cool to use nestang.

40Pins RGB LCD

seems the core only supports HDMI with 720p output. Will it support the 40pin RGB LCD as well? and will the core have an option for 4:3 output for 240p/480p?

USB controller (DIY) not working [ Tang Nano 20K ]

Update - I reflashed v0.6 and it seemed to work a bit better. However, trying all my controllers I was only able to achieve any input functionality with (1) ROM, and (1) controller. All buttons responded only in the nestang menu and a 240p test suite NES rom using an NES-to-USB adapter.

However, testing any common NES game (SMB1, TMNT3, etc.) none of the controls would respond via USB gamepad, using the same NES-to-USB adapter or any other controller I have.

-- Old post --
I followed the guide and wired my own USB port:

  • Pin 41 --> (D-) [white wire]
  • Pin 42 --> (D+) [green wire]
  • 15K resistor on each data line going to GND
  • 5V (Nano) --> 5V [red wire]
  • GND (Nano) --> GND_USB [black wire]

I've tried the following USB gamepads I own and haven't had any response from ROM select menu:

Sega Genesis Classic 3-Button | ID 0ca3:0025 | Sega Corp. 3B controller
SNES to USB Adapter | ID 0925:8866 | Lakeview Research WiseGroup Ltd, MP-8866 Dual Joypad
Gravis Gamepad Pro  | ID 0428:4001 | Advanced Gravis Computer Tech, Ltd GamePad Pro (if this isn't low-speed I'm not sure what is.)

This one controller eventually worked, but only on the nestang menu and one NES test ROM, but not in any common game like SMB1.
NES Controller to USB Adapter | ID 1d57:0021 | Xenta NES PC Game Pad

  • I'm only using one USB port instead of the two shown, but I assume wiring only one USB doesn't affect operation? I've also tried wiring to port 2 (pins 56/54) to no avail.
  • I'm using nestang v0.6 which has USB gamepad support.
  • I've tried swapping data pins to no avail. Likewise tried with and without the pulldowns.

This is a great project, just not sure what I'm missing here for USB gamepad to work. Perhaps I'm overlooking something. Thanks in advance!

HDMI and sound update from upstream

Need to look into this:

There's an update to fix a major HDMI bug used in verilog code for NESTang.
It fixes data island offset bug that prevented many sinks from functioning properly.

Also there's a bug in sound generation using the old APU implementation. The waveforms miss the high pitch notes which is vivid in some games like SMB3 and the first TMNT on most screens. I even wrote some modifications on the original NES core to output sound via AUX and it has the same issue.

Mister NES core utilizes an updated system verilog module with more high-pitch friendly synth tables. The original core author intended to use these values for Nexys board with a different DAC type.

[Migration to softcore] Some issues bringing up the uC

@nand2mario, so I've been checking Design notes for SNESTang, Adding a Softcore to SNESTang - part 1 and Adding a Softcore to SNESTang - part 2 and trying to adapt src/iosys and firmware to Nano20k here: fjpolo/TangNano20k_Softcore.

So far the idea was to have a simple while(1) to blink LED[0] every second. For that I just added the while(1) before the proper code in firmware.c's main(). I also added #define reg_led (*(volatile uint32_t*)0x02000060) in picorv32.h and led_reg = mem_valid && (mem_addr == 32'h 0200_0060); in iosys.v, where I also added output [1:0] led and assign led = led; to connect it to the board in nestang_top.sv.

I tried to add some control logic for the RV RAM, but probably I am missing something there, it might be that iosys is loading the .bin into 0x000000 and that's the NES' RAM. Or it can be that MemoryController is incorrect.

It could also be that Flash's not configured/working correctly, since I tried assign led[0] = flash_loaded; in iosys.v and led[0] stays low. I guess the configuration for Flash pins is correct:

image

Would you mind taking a quick look at the branch to see if you see something there?

Support USB FS / XInput controllers

This applies to XBOX 360 controller, and many 3rd part controllers like 8bitdo ones.

Will need to get USB full-speed to work to support these controllers.

[0.9][Nano][Cannot load ROM][f_puts failed] Latest master build won't load ROMs

I checked out latest master and built it myself. OSD seems to be working, if I place ROMS inside any dir and press A on that dir, OSD goes back to main menu.

If I press options and try to change any options I get an error:

IMG_20240409_154527

If I try to load a ROM from root dir, there's an error:

IMG_20240409_154707

FYI I tried using a 8Gb miniSD card formatted as FAT32 in 16kB sectors and also 2048bytes sectors, same result.

Anyone else having similar issues?

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.