"Still Alive" (Sega-to-Sega communication) demo

Talk about anything else you want

Moderator: BigEvilCorporation

Post Reply
Very interested
Posts: 75
Joined: Sun Jan 04, 2015 10:27 pm
Location: Pennsylvania

"Still Alive" (Sega-to-Sega communication) demo

Post by MrTamk1s » Thu Jun 25, 2015 3:50 am

Am cross posting this thread from Sega-16 because it is too cool! Apparently one of the members from Sega-16 created a program that runs the credits "Still Alive" sequence from Portal, using a master-slave configuration and serial communication between 2 Sega Genesi via controller port #2 on both.

Youtube video

The master Genesis runs the master program from a flash cart, draws the text to a monitor, and sends commands to the slave. The slave, which could run it's slave program from another flashcart or from a Sega CD ISO (!), accepts the master's commands to draw ASCII graphics, and displays it on another monitor. Am very curious as to the exact technical details on how this works, especially with the Sega CD option (unfortunately, the author has not given out source code, but only a brief code explanation). My guess is that is he is using a modified Zero Tolerance 2-player network link styled serial interface to communicate between the two Genesi (the Youtube comments hint to this).

So, out of curiousity, what exactly would it take for Sega-to-Sega communications ("S2S" communication :P) code-wise, and what other cool things could we do with it :)? Has anyone ever done any technical research or demos with the Zero Tolerance 2P serial communication protocal? The only thing I could find about it on Spritesmind was this.

(This thread probably should have been posted under "hardware"...)
SGDK homebrew dev and Unity3D Indie dev.
Sega does what Nintendont!

Very interested
Posts: 192
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz » Thu Jun 25, 2015 3:43 pm

The I/O ports have 7 pins which can be programmed as input or output, so it's possible to program any protocol you like to exchange data between the machines or even PC parallel port. The achievable bitrate is in tens of KiB/s.

Posts: 27
Joined: Sun Jun 28, 2015 4:18 pm

Post by ComradeOj » Sat Jul 11, 2015 1:32 pm

Person that programmed the demo here.
Sorry for taking forever! I signed up for a spritesmind account about two weeks ago, and I just now got approved.

Initially, I didn't post the source code because I didn't think very many people would care.

Here is the download link for the source code, if you're still interested. I included the master, slave, and slave sega cd code.

https://drive.google.com/file/d/0B-uZnR ... sp=sharing

All you need to do to compile the program, is click the make.bat. No special programs needed. The included 68k compiler is for windows, but I've been able to compile it on linux using wine.

The sega cd version is just a hacky port. It doesn't even display correctly unless you run it on an overclocked system. The reason being, I couldn't get the HBLANK interrupt working on the SEGA CD, so I had to improvise. I'm using the HBLANK to scale the graphics vertically to fill the screen.

Another thing is the communication via the controller ports. I'm just using the standard 3 button controller port reading routine. I think this was causing the high nibble of a sent byte to come out shifted 2 places to the left. I didn't have an everdrive at the time of developing the demo, so I had to do all my testing via porting my code to the sega cd. I didn't want to have to keep experimenting, so I just programmed the demo, accounting for the shift.

I'm fairly sure cutting out the "lsl.b #$2, d7" instruction from the slave program would fix the problem and give you correct communication. But like I said, I wasn't able to do lots of testing, so I just compensated for the shift.

I can answer any questions if you have any.

Posts: 1131
Joined: Tue Aug 29, 2006 10:56 am

Post by KanedaFr » Mon Jul 13, 2015 3:52 pm

thanks for sharing
and sorry for the delay ( trying to fight spams but it doesn't seems to be way to do :( )

Post Reply