I have a board, NES, and cartridge and had done a project a few years ago communicating with NES controller to control a pong game. I didn't have any grand reason, just had the hardware available and got curious if I could get a working setup that could play SMB. I saw some other projects using shift register chips, but thought I could get it to play without any other extra hardware. I started off writing some FPGA code to burn into the Arduino to handle the controller protocol but found that I didn't need that since I could run the board at 64MHz which is plenty fast for the NES. It is fully functioning now and completes the game, though I am trying to add some features.
- I have used a borrowed Saleae logic analyzer to look at my signals, I notice that when I send button data my latch signal fluctuates and I've had to compensate for that by disabling the latch handler until my writes are done
- I create my TAS video, get the raw text version of it, and use a perl script to turn it into button state instructions for the Arduino
- I'm using the original SMB/Duck Hunt cart that was shipped with the system
- I've attached an interrupt for both latch and pulse signals, so I initiate a transaction when the latch signal is seen and send each button's state per pulse
- I haven't measured my latency, though I have disabled Arduino's standard timer interrupt and I try to keep my interrupt tasks very tight. I'm writing to the port registers directly instead of Arduino's "digitalWrite" to avoid pin overhead as best I can
- I load my frame data before the interrupt so when the signal comes in I can write my data asap
- That's interesting, I haven't run into any trouble with the latch signal at power on, but I'll keep that in mind if I see any issue
- The bot is loading everything on its own, it isn't connected to the PC at all and even gets its power from the NES controller 5V line. I'm trying to add an SD card for arbitrary loads and it seems like the NES is not able to stably power the board as well as the SD card so it seems like I'll have to change that.
Right now my setup is very specific to running SMB and changing the playback is difficult, which is why I'm trying to get the load from SD card working. If things go well, I'd like to try other games and maybe move to a SNES.