SNESnet - 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
SNESnet - SNES Ethernet adapter
by on (#152448)
hello nesdev ^^
maybe this is interesting for some of you :>
it's an open source snes network adapter, with some server/homebrew example

SNESnet is using a NM7010B+ modul from Wiznet. (compatible with w5xxx chips)
It communicates through two (Pin 25/26) of the eight (Pin 19-26) cpu-io bit, that are available on the controller ports.

Details
  • NM7010B+ Modul
  • Atmega168
  • can send data from a homebrew to a server (IO-Port)
  • can receive data from a server on controller port 2
  • is using a dedicated 5v power supply
  • demo server in java on github
  • crypted password on login
  • multiuser server
  • auto-reconnect on disconnects

Download:
https://github.com/saturnu/snesnet

This is a screenshot, which captures a real snes and the java server debug output.
(the demo homebrew/server is on github, too)
Image


bsnes-plus + vsnesnet
the github repository features a bsnes-plus patch and a simulator called vsnesnet, it's compatible with
the hardware implementation and could be used for development.
Image

greetings saturnu
Re: SNESnet - SNES Ethernet adapter
by on (#152459)
saturnu wrote:
it's an open source snes network adapter, with some server/homebrew example


I've been meaning to create a serial adapter for debugging my SNES for a while now. Being distracted by a lot of things lately.

I was going to use a teensy to create a SNES->USB adapter. Your idea looks easier to code on the computer side.


Reading through the source I noticed that snesnet.c seams to indicate your transmitting at 30 bits/second. Am I reading that wrong?

If you can tell me the hold time for reading bits on the micro-controller, I can code you some tcc-65816 compatible assembly that would dramatically increase your bandwidth.

According to byuu (and my memory of his old forums), you should be able to get a reliable ~300kbit/s using a asynchronous protocol (like you have) and a micro-controller.
Re: SNESnet - SNES Ethernet adapter
by on (#152477)
Yeah, this is my design with a Teensy microcontroller: (initial design + firmware was from blargg)

Image

The connectors for it are DB9, for which I made SNES deck <> DB9 and DB9 <> SNES controller adapters.

The result is you can use a controller and the serial transfer at the same time, controllable either via PIO, or for stupid games that clear PIO for no reason (Tales of Phantasia) via psycial SPST switch.

I use USART and can transfer at 30-40KB/s bidirectionally. So about 10,000 times faster than yours (sorry :P)
Also, my USART is emulated in bsnes/higan as well.

On the serial end, I use a serial<>USB cable, so the PC communicates over USB. Much more friendly than an ethernet jack (although I guess you could by an ethernet<>USB adapter ...)

Anyway, you won't get any faster by using both controller ports simultaneously. Only way to beat the speed I've reached is to use the extension port on the bottom of the SNES and go for the full 2.68MB/s. Good luck with that.
Re: SNESnet - SNES Ethernet adapter
by on (#152496)
if i wanted a direct computer debug connection, i can use my sd2snes with usb.
the whole point of ethernet is, that it doesn't need any extra computer hardware.

maybe the EMW3165 or ESP8266 wifi chip would be a nice replacment.
Re: SNESnet - SNES Ethernet adapter
by on (#152592)
> the whole point of ethernet is, that it doesn't need any extra computer hardware.

Where you do you intend to plug that ethernet cord into? And how is that different from using a DB9/USB cable instead?

I'm all for cool uses and ideas, and this is fun to see, but 30 bits per second is really slow >_>
At the very least, try and do a synchronous transfer if possible, eg: "00 => new byte start", "10 = 0-bit", "11 = 1-bit", "01 => go to next bit"; so that you don't have to choose between ridiculously long waits between pin changes and writing very tough asynchronous timing code (that still won't be anywhere near as fast as synchronous.)
Re: SNESnet - SNES Ethernet adapter
by on (#152608)
> Where you do you intend to plug that ethernet cord into? And how is that different from using a DB9/USB cable instead?
i hope this is a rhetorical question. ^^

this is just the way i implemented it.
sure i could speed this up even with a async transfer, but i don't care much about the transfer speed.
Re: SNESnet - SNES Ethernet adapter
by on (#152617)
> i hope this is a rhetorical question. ^^

Not at all.

You said you used ethernet so you didn't need any extra computer hardware. But a loose ethernet cable must plug into something else to be useful, which is exactly the same for my DB9.

The computer you must plug that ethernet cable into is your extra hardware. In my case, I have a Teensy sitting between the SNES and the PC, sure, but even then you could get away with wiring the SNES pins directly to a DB9 port, although you'd be back to plain old UART and nasty baud rates.

Anyway, it's no big deal, and again, I think it's a neat project and appreciate you showing it to us! As long as you're okay with the limited utility, and had fun making it, then it's all good :D
Re: SNESnet - SNES Ethernet adapter
by on (#152640)
byuu wrote:
The computer you must plug that ethernet cable into is your extra hardware.


I'll just leave this here:
The goal of this device is to give the SNES stand-alone networking capabilities and enable online multiplayer support, not establish connection with or by means of a local desktop computer.
Re: SNESnet - SNES Ethernet adapter
by on (#152643)
The module that you're using includes an Ethernet NIC and microcontroller that handles the Internet protocol suite. But games would still have to be rewritten because they run with the assumption of zero control lag and perfect sync.
Re: SNESnet - SNES Ethernet adapter
by on (#152657)
sure i know that. ^^
i think you have the misassumption, that this is for retail games. it's not, it's for homebrew software that is written especially for this device.

btw. the W3150A+ needs an external PHY chip and with the W5xxx it's embedded, that's all.
Re: SNESnet - SNES Ethernet adapter
by on (#152668)
> The goal of this device is to give the SNES stand-alone networking capabilities and enable online multiplayer support, not establish connection with or by means of a local desktop computer.

But how? So he has an SNES<>ethernet cord, right? You can't just plug that into a port on the back of your router and voila, now you're playing with other SNES decks like this around the world.

It requires computer software (eg the Java server in the Git repo), and computer software requires hardware. So how is this different than the server talking to the SNES via DB9? Or USB? Or anything else? You still need something to convert the raw SNES lines (IObit, clock, latch, etc) being carried to the other ends of these wires into something usable. And that 'something' can do online netplay regardless of the connector used.

I feel like I'm missing something that's obvious to you guys >_>
Re: SNESnet - SNES Ethernet adapter
by on (#152674)
exactly :D
but this computer is just somewhere on the internet and shared by all users.
i just wanted to point out that you don't need extra hardware in your living room as a network gateway. ^^

it should be possible to use your teensy, usb and something like a raspberry pi with some gateway software, too.
even if small soc computers are cheap today, what's the point of adding this extra layer instead of just using an ethernet module directly.
Re: SNESnet - SNES Ethernet adapter
by on (#152678)
I think the idea is that the server software runs on a server in a rack in a datacenter somewhere, and the client software is homebrew that runs on a Super NES. The microcontroller in this adapter just translates IP into something the Super NES can more easily process.