SNESoIP: The SNES ethernet adapter

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
SNESoIP: The SNES ethernet adapter
by on (#117273)
Hello everybody,
this is my first post on this board, so let me say hello! I'm an hobby engineer and SNES enthusiast from Stuttgart, Germany and after 4 weeks of work I want to present you my current project: the SNESoIP.

The SNESoIP ethernet adapter for the Super Nintendo/Famicom will be an open-source, proof-of-concept, network-bridge for sharing local controller-inputs over the Internet.

The project it currently in its early stage, but fully functional and could be used to play multiplayer games over the Internet. Also some kind of server-controlled BBS system could be conceivable as a future project.

Images
2013-08-28-prototype-01.jpg
2013-08-28-prototype-02.jpg
2013-08-28-prototype-03.jpg

Features
    - Plug and play (IP is obtained via DHCP),
    - DNS lookup of the server hostname,
    - small firmware size (fits on an ATmega8),
    - easy to rebuild (even on a stripboard),
    - low component count,
    - adaption of other platforms (e.g. Sega Mega Drive) is possible
    - possible cross-platform capability.

Todo
    - Some kind of interface to avoid hard-coded configuration,
    - detailed documentation.

How it works
Communication
The SNESoIP ethernet adapter is continously sending 4-byte data packets via UDP to a (remote) server and may receive 2-byte answer packets from the (remote) server.

A packet sent to the server has the following format:

    Byte 1: Controller Data Lo-Byte
    Byte 2: Controller Data Hi-Byte
    Byte 3: CID
    Byte 4: P2CID

An answer packet has the following format:

    Byte 1: Controller Data Lo-Byte
    Byte 2: Controller Data Hi-Byte

The 2-byte Controller Data field holds the state of SNES controller which is basically a 16 bit shift register of which 12 bits are being used to represent button states (unused bits are pulled high).

CID is a value uniqely identifying the sending controller instance to the server and used to store its state on the server.

P2CID is the CID of your selected "Player Two". The server will answer your packet with the controller data of the controller identified by P2CID.

Update packets are being sent to the server continously even if the local controller state does not change state.

Switch Mode
To ease sorting out which player is to play as player 1 and which is to play as player 2 and prevent tedious interchanging of plugs the SNESoIP implements a "Switched mode" which exchanges player 1 and 2 in software.

To activate "Switched mode" simply hold down the B and Y keys of your controller while booting the SNESoIP. If successful, the SNESoIP's LED will blink briefly.

To deactivate "Switch Mode", simply reboot the SNESoIP without any buttons held down.

As I said, the project is currently in an early stage and will be released under the terms of a BSD-like license after it passes the current testing-phase. Till then feel free to discuss or ask me any questions related to this topic. :)

Greetings
Michael

PS: The original topic can be found at snesfreaks.com (german).
Re: SNESoIP: The SNES ethernet adapter
by on (#117276)
Google translation of discussion

I take it you plan on having two SNES consoles linked over IP, with both running the same game and two people playing a two-player game. If so, how will the two SNES consoles stay in sync?
Re: SNESoIP: The SNES ethernet adapter
by on (#117280)
blargg wrote:
Google translation of discussion

I take it you plan on having two SNES consoles linked over IP, with both running the same game and two people playing a two-player game. If so, how will the two SNES consoles stay in sync?

That's right but to be honest, I ignore synchronization issues, random events and possible network latency, because I can not say anything about it without further testing. The second prototype is currently on its way to a beta tester, so I've to wait a few days. :)

Anyways, this is just one possible application. I'm currently thinking about some kind of BBS or server-controlled online game where the SNESoIP can download information at any time. Synchronization should not affect that.

PS: Please be indulgent; english is not my native language. 8-)
Re: SNESoIP: The SNES ethernet adapter
by on (#117281)
X-Band required games to be hacked/patched to eliminate random behaviors because it functioned in a similar way where controller data was exchanged, and probably some pre&post game communications. This can work, but it's critical not to let anything possibly desync the two consoles and their game states.
Re: SNESoIP: The SNES ethernet adapter
by on (#117284)
Likewise, games supporting GGPO delay the local effect of controller presses by about three to four frames (just over half a ping) so that they arrive on time on average, and the engine has to be able to rewind to a saved state and catch up should they fall out of sync due to unexpected lag.
Re: SNESoIP: The SNES ethernet adapter
by on (#117287)
This is awesome! Keep us posted on your development of this concept; it could become huge in the retro gaming community! :D
Re: SNESoIP: The SNES ethernet adapter
by on (#117288)
Good luck with your project.
Re: SNESoIP: The SNES ethernet adapter
by on (#117298)
Thank you guys.

PS: The second prototype has just arrived and i will probably start testing later this day. If it work as expected, I will upload the project files to GitHub.
Re: SNESoIP: The SNES ethernet adapter
by on (#117307)
http://www.youtube.com/watch?v=8fhYhGJ80Dg

Random events fucked it up, but at least we did it!
Re: SNESoIP: The SNES ethernet adapter
by on (#117316)
Nice job, even despite the sync issues.
Re: SNESoIP: The SNES ethernet adapter
by on (#117330)
The tester accidently played in 60hz mode. Now we successfully played through the first two levels of Zombies ate my neighbours.
We also did some measurement with a custom ROM: we get an delay of 2-4 frames but after a few inputs, everything is in sync again. Success!
Re: SNESoIP: The SNES ethernet adapter
by on (#117406)
http://www.youtube.com/watch?v=HuvGpi55xsI
Re: SNESoIP: The SNES ethernet adapter
by on (#117416)
Cool project, although I can't say your videos are meaningful at all. :)

Edit: Stuttgart? That's where I was born. :D
Re: SNESoIP: The SNES ethernet adapter
by on (#117418)
I'm assuming the running into corners is an attempt to have both games in sync?
Re: SNESoIP: The SNES ethernet adapter
by on (#117420)
That was my assumption, or that it was inadvertent and ending up acting as a limit on how out-of-sync they could get. It'd probably be fun to see a video of both NES screens at once.
Re: SNESoIP: The SNES ethernet adapter
by on (#117449)
Ramsis wrote:
Cool project, although I can't say your videos are meaningful at all. :)

Edit: Stuttgart? That's where I was born. :D

Thank you. And they're not ment to be meaningful. It's just a demonstration.
You where born in Stuttgart and left voluntarily? Sorry, but I can't believe that. :P

MottZilla wrote:
I'm assuming the running into corners is an attempt to have both games in sync?

That's right. But it's not a real sync problem. Sometimes the zombies are holding you back. Zombies who can't be seen on the opposite site and vice-versa.

blargg wrote:
That was my assumption, or that it was inadvertent and ending up acting as a limit on how out-of-sync they could get. It'd probably be fun to see a video of both NES screens at once.

We're working on that. :)
Re: SNESoIP: The SNES ethernet adapter
by on (#117457)
The project is now on GitHub: https://github.com/mupfelofen-de/SNESoIP

Greetings
Michael

PS: If you like this project, please donate to support further development. Thanks! :)
Re: SNESoIP: The SNES ethernet adapter
by on (#117573)
https://github.com/mupfelofen-de/SNESoI ... n/keyboard

https://github.com/mupfelofen-de/SNESoI ... totype.jpg

Every hacker needs a keybord, right? :)
Re: SNESoIP: The SNES ethernet adapter
by on (#117575)
Interesting. How does this PS/2 keyboard adapter interface to the SNES? I wonder whether this would be useful for the NES as well, especially considering another member who's a real big fan of the Famicom keyboard. I know it wouldn't be binary-compatible with software expecting the Famicom keyboard, but I imagine that programs expecting the Famicom keyboard could be ported.
Re: SNESoIP: The SNES ethernet adapter
by on (#117578)
tepples wrote:
Interesting. How does this PS/2 keyboard adapter interface to the SNES? I wonder whether this would be useful for the NES as well, especially considering another member who's a real big fan of the Famicom keyboard. I know it wouldn't be binary-compatible with software expecting the Famicom keyboard, but I imagine that programs expecting the Famicom keyboard could be ported.

Technically, the SNES controller ports are just serial interfaces. So, I used Atmel's application note AVR313 to interface the PS/2-keyboard (FYI: It works pretty well with USB-keyboards using an adapter). After I had the data, I used some of the SNESoIP source code to forward it to the SNES.

NES controllers are quite similar, so it is probably pretty easy to adapt this project. Even Famicom-keyboard compatible.
Re: SNESoIP: The SNES ethernet adapter
by on (#117583)
Which leads to another bright idea: Given how rare the Super NES Mouse has become, I imagine there are a lot of people who would appreciate having an adapter for using a PS/2 mouse with Mario Paint, On the Ball, and other games supporting mouse control. I wonder if you could get retrousb.com or infiniteneslives.com to manufacture such an adapter in quantity.
Re: SNESoIP: The SNES ethernet adapter
by on (#117728)
Some real internet gameplay comparison:

https://vimeo.com/74037954

PS: As I said before; this isn't the only possible application for this project. But it was a good starting point. :)
Re: SNESoIP: The SNES ethernet adapter
by on (#117756)
It looks like sync is a big problem.
Re: SNESoIP: The SNES ethernet adapter
by on (#123107)
We're currently working on a different server/client concept.
Of course, sync would still be a problem but it's probably a step into the right direction.
And we did some experiments with custom homebrew too. This is quite interesting because it could be used to transfer custom data from the server. e.g images etc.

Well, what I'm trying to say is: the project is not dead yet, heh. :)

Greets
Michael
Re: SNESoIP: The SNES ethernet adapter
by on (#123121)
http://snesoip.de/

User: demo
Password: demo

New web interface for the upcoming server concept. Fully functional.
Next: Server/Firmware integration.
Re: SNESoIP: The SNES ethernet adapter
by on (#123227)
I just wrote a small ROM to display a custom text sent by the server. Works.
Re: SNESoIP: The SNES ethernet adapter
by on (#123233)
nice :beer:
Re: SNESoIP: The SNES ethernet adapter
by on (#123242)
Source code: https://github.com/mupfelofen-de/SNESoI ... snes/ascii
Re: SNESoIP: The SNES ethernet adapter
by on (#123363)
The worlds first read-only SNES IRC client, hehe. :)
The server acts basically as an irssi log parser. Works quite well.
Re: SNESoIP: The SNES ethernet adapter
by on (#123364)
very cool
Re: SNESoIP: The SNES ethernet adapter
by on (#123365)
bazz wrote:
very cool


Thanks! I wish I could type. *g*
Definitely something I want to implement in the future. :lol:

-- Edit:
Sour code: https://github.com/mupfelofen-de/SNESoI ... /logserver
Re: SNESoIP: The SNES ethernet adapter
by on (#124048)
I started building about 50 devices. If anyone is seriously interested in this project and further development, let me know.
Re: SNESoIP: The SNES ethernet adapter
by on (#124084)
I'm very interested in the project and the potential it brings. In order for me to actually spend money on it though, the synchronization and latency issues would need to be resolved, or at least a lot better. I understand you're working on it of course, and am optimistic based on what you have shown so far.
Re: SNESoIP: The SNES ethernet adapter
by on (#125126)
naI wrote:
I'm very interested in the project and the potential it brings. In order for me to actually spend money on it though, the synchronization and latency issues would need to be resolved, or at least a lot better. I understand you're working on it of course, and am optimistic based on what you have shown so far.


I guess, I should mention again that the project isn't all about sharing controller inputs. But yes, you're right. This part has to be improved and we're working on it. :)
But currently my focus lies on the hardware and the ethernet bootloader for firmware upgrades via the server. :)

And now some progress updates:
Re: SNESoIP: The SNES ethernet adapter
by on (#125810)
https://www.dropbox.com/s/zprdvt6l33sc2 ... v2-pcb.jpg
Re: SNESoIP: The SNES ethernet adapter
by on (#135054)
It's still a long way before the next release and the planned beta test, but here are some progress updates:

https://github.com/mupfelofen-de/SNESoI ... /README.md

We're currently working on the login and the WRIO functionality.
In a word: the project is still pretty active. :-)
But the main focus is now homebrew software instead of syncing multiplayer games.

Greetings
Michael
Re: SNESoIP: The SNES ethernet adapter
by on (#135058)
Such an awesome project.

Wouldn't the current device already be suitable for remote multiplayer without synchronization problems by using the following setup?:
  • Player 1 has SNES with normal controller connected to port 1 and SNESoIP connected to port 2
  • Player 2, in another country, uses a USB gamepad (or modified SNES gamepad connected to network) to send commands through Player 1's SNESoIP over the internet
  • A webcam pointed at Player 1's TV allows Player 2 to hear and see what's happening.

I think this would already be fabulously awesome, allowing me to play my favorite games alongside my favorite buddies, liberated from the tyranny of distance (sic semper!). Why add the complexity of multiple SNESes?
Re: SNESoIP: The SNES ethernet adapter
by on (#135059)
...latency?

I can't even imagine trying to play Mario Kart over a webcam...
Re: SNESoIP: The SNES ethernet adapter
by on (#135060)
Heh, good point, but with decent network infrastructure you could get a round-trip in the tens of milliseconds, which I think would be playable.
Re: SNESoIP: The SNES ethernet adapter
by on (#135061)
Are you talking about OnLive or Gaikai?
Re: SNESoIP: The SNES ethernet adapter
by on (#135063)
thenendo wrote:
I think this would already be fabulously awesome, allowing me to play my favorite games alongside my favorite buddies, liberated from the tyranny of distance (sic semper!). Why add the complexity of multiple SNESes?

Because this isn't really the goal of this project. We have the possibility to transfer data, so why not use it to create some real server based online games. :)

93143 wrote:
...latency?

I can't even imagine trying to play Mario Kart over a webcam...

Me neither, heh. I would prefer emulation with netplay support.
Re: SNESoIP: The SNES ethernet adapter
by on (#135097)
Will I be able to play with my friends in denmark with this piece of hardware?

Furthermore - is there any option to convert this into a volery?
Re: SNESoIP: The SNES ethernet adapter
by on (#135103)
jensma wrote:
Furthermore - is there any option to convert this into a volery?

Sure, go ahead. I sent you one for a reason.