Real NES Plays Frame-Perfect For You On Twitch

Have you ever wanted to be the best Super Mario Brothers speedrunner, but you just couldn’t do the frame-perfect inputs? Fear not, because [Gregory Strike] is here to save the day with his automatic NES controller!

In his previous video, [Greg] already made an automatic controller that plays a sequence of inputs at the perfect time, but it still failed some of the frame-perfect tricks. So what gives? Deviation in the timing of the NES itself gives, as he shows how the NES doesn’t sample inputs at exactly the same time every frame. To account for this, he used the latch signal, which starts the controller reading process as a time reference, and replaced his digital “mixtape” with a more time-flexible Arduino. After the modification, he shows it pulling off frame-perfect inputs every time he plays Super Mario Brothers.

But if you have a controller that can do frame-perfect inputs and it can be connected to a computer, you can connect the controller to the internet! That’s right, [Greg] created a Twitch bot that tells the Arduino exactly what inputs to send, which then relays it to the NES. It accepts simple sequences of inputs via chat, and you can try it out right now on [Greg]’s Twitch stream.

This project shows promising results, and we think it’s possible to do much more with its internet connection. We’re certainly looking forward to what [Greg] decides to make next.

Video after the break.

3 thoughts on “Real NES Plays Frame-Perfect For You On Twitch


    Similar projects allow you to download and play back the button presses for speedruns. Many games don’t sample the controller every frame due to game logic taking longer than 1 frame. These frames are called “lag frames” and the latch signal is never asserted, so you can strip them out of the input file using an emulator and a script.

    The internet connectivity looks like fun.

    1. M1ke, you may have just answered a question I had… I have a script that I wanted to release with this video, it converts FCUEX FM3 (TAS Editor) files into NESA (the “language” the Twitch bot uses). I didn’t release it though because there was a timing issue of some kind… I believe TAS Editor highlights these “lag frames” in red, but, it never occurred to me that the NES didn’t assert the Latch, which would be the reason the count would be off. Digging into it now, thanks man.

      1. FCEUX has a lua scripting interface you can use for many things.
        You can use emu.frameadvance() to advance a frame at a time, read the joypad inputs via something like and check for lagframes with emu.lagged()

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.