Page 3 of 57

Re: SaturnPi

Posted: Mon Oct 17, 2016 6:24 pm
by -drez01-
pcwzrd13 has a good point and nothing will be as good as an analogue telephone line in terms of latency for Netlink.

Compression is one factor of latency. Servers used by VoIP companies and VoIP devices themselves also contribute lag.

Though you can minimize the lag by bypassing the VoIP serves with a direct connection and turn off compression in the device, the adapters themselves still create latency and that is unavoidable.

Maybe your right. This is all speculation but perhaps the best way to do this without a phone line is if you could directly connect 2 pi's together online, or to a server wich sole purpose is to be the middleman in that configuration.

Re: SaturnPi

Posted: Fri Oct 21, 2016 5:11 pm
by Xiden
So the creators of Yabause Sega Saturn Emulator actually has emulated Netlink over LAN/Internet with their Saturn Emulator. Since he knows how Netlink works I'm wondering if he could provide software for Netlinks to connect to a central server...

They have a contact page, but doesn't appear to have a direct emails listed. I might post something on their message board.

More Info
https://yabause.org/2013/12/15/yabause- ... -10-years/

Re: SaturnPi

Posted: Fri Oct 21, 2016 5:15 pm
by Xiden
Actually looks like he has it available as open source. Unfortunately I only program in C#/VB.Net/Java, I'm certain he programs in C++ (Haven't examined the source code yet).

Found interesting reading on Netlink initialization

http://wiki.yabause.org/index.php5?title=Netlink

Re: SaturnPi

Posted: Fri Oct 21, 2016 6:57 pm
by itsthinkingstill
This is a Amazing find!!!!! this actually wouldn't take too much work i think to transfer to dreampi. PC call up kazade and lets get this sucker working!

Re: SaturnPi

Posted: Fri Oct 21, 2016 7:03 pm
by itsthinkingstill
As for contacting the team a good way to do it i guess would to comment in one of their newest topics on their website or maybe over at the sega xtreme forms as i think some of the members of the team are there

Re: SaturnPi

Posted: Thu Nov 10, 2016 10:44 pm
by itsthinkingstill
Okay after some help over at sega xtreme i found the netlink emulation code from yabause

*/

#ifndef NETLINK_H
#define NETLINK_H

#include "sock.h"

#define NETLINK_BUFFER_SIZE 1024

enum NL_RESULTCODE
{
NL_RESULTCODE_OK=0,
NL_RESULTCODE_CONNECT,
NL_RESULTCODE_RING,
NL_RESULTCODE_NOCARRIER,
NL_RESULTCODE_ERROR,
NL_RESULTCODE_CONNECT1200,
NL_RESULTCODE_NODIALTONE,
NL_RESULTCODE_BUSY,
NL_RESULTCODE_NOANSWER,
};

enum NL_CONNECTSTATUS
{
NL_CONNECTSTATUS_IDLE,
NL_CONNECTSTATUS_WAIT,
NL_CONNECTSTATUS_CONNECT,
NL_CONNECTSTATUS_LOGIN1,
NL_CONNECTSTATUS_LOGIN2,
NL_CONNECTSTATUS_LOGIN3,
NL_CONNECTSTATUS_CONNECTED,
};

enum NL_MODEMSTATE
{
NL_MODEMSTATE_COMMAND,
NL_MODEMSTATE_DATA,
};

typedef struct
{
u8 RBR;
u8 THR;
u8 IER;
u8 DLL;
u8 DLM;
u8 IIR;
u8 FCR;
u8 LCR;
u8 MCR;
u8 LSR;
u8 MSR;
u8 SCR;
u8 SREG[256];
} netlinkregs_struct;

typedef struct {
volatile u8 inbuffer[NETLINK_BUFFER_SIZE];
volatile u8 outbuffer[NETLINK_BUFFER_SIZE];
volatile u32 inbufferstart, inbufferend, inbuffersize;
volatile int inbufferupdate;
volatile u32 outbufferstart, outbufferend, outbuffersize;
volatile int outbufferupdate;
netlinkregs_struct reg;
int isechoenab;
YabSock listensocket;
YabSock connectsocket;
YabSock clientsocket;
enum NL_CONNECTSTATUS connectstatus;
u32 cycles;
enum NL_MODEMSTATE modemstate;
char ipstring[16];
char portstring[6];
u32 connect_time, connect_timeout;
int internet_enable;
volatile u32 thb_write_time;
int escape_count;
} Netlink;

typedef struct
{
char ip[16];
int port;
YabSock sock;
} netlink_thread;

extern Netlink *NetlinkArea;

u8 FASTCALL NetlinkReadByte(SH2_struct *sh, u32 addr);
void FASTCALL NetlinkWriteByte(SH2_struct *sh, u32 addr, u8 val);
int NetlinkInit(const char *ip, const char *port);
void NetlinkDeInit(void);
void NetlinkExec(u32 timing);

#endif

The next one is very long so here is the links
https://github.com/Yabause/yabause/blob ... /netlink.c
https://github.com/Yabause/yabause/blob ... /netlink.h

Re: SaturnPi

Posted: Mon Nov 14, 2016 11:43 am
by Xiden
itsthinkingstill wrote:Okay after some help over at sega xtreme i found the netlink emulation code from yabause

*/

#ifndef NETLINK_H
#define NETLINK_H

#include "sock.h"

#define NETLINK_BUFFER_SIZE 1024

enum NL_RESULTCODE
{
NL_RESULTCODE_OK=0,
NL_RESULTCODE_CONNECT,
NL_RESULTCODE_RING,
NL_RESULTCODE_NOCARRIER,
NL_RESULTCODE_ERROR,
NL_RESULTCODE_CONNECT1200,
NL_RESULTCODE_NODIALTONE,
NL_RESULTCODE_BUSY,
NL_RESULTCODE_NOANSWER,
};

enum NL_CONNECTSTATUS
{
NL_CONNECTSTATUS_IDLE,
NL_CONNECTSTATUS_WAIT,
NL_CONNECTSTATUS_CONNECT,
NL_CONNECTSTATUS_LOGIN1,
NL_CONNECTSTATUS_LOGIN2,
NL_CONNECTSTATUS_LOGIN3,
NL_CONNECTSTATUS_CONNECTED,
};

enum NL_MODEMSTATE
{
NL_MODEMSTATE_COMMAND,
NL_MODEMSTATE_DATA,
};

typedef struct
{
u8 RBR;
u8 THR;
u8 IER;
u8 DLL;
u8 DLM;
u8 IIR;
u8 FCR;
u8 LCR;
u8 MCR;
u8 LSR;
u8 MSR;
u8 SCR;
u8 SREG[256];
} netlinkregs_struct;

typedef struct {
volatile u8 inbuffer[NETLINK_BUFFER_SIZE];
volatile u8 outbuffer[NETLINK_BUFFER_SIZE];
volatile u32 inbufferstart, inbufferend, inbuffersize;
volatile int inbufferupdate;
volatile u32 outbufferstart, outbufferend, outbuffersize;
volatile int outbufferupdate;
netlinkregs_struct reg;
int isechoenab;
YabSock listensocket;
YabSock connectsocket;
YabSock clientsocket;
enum NL_CONNECTSTATUS connectstatus;
u32 cycles;
enum NL_MODEMSTATE modemstate;
char ipstring[16];
char portstring[6];
u32 connect_time, connect_timeout;
int internet_enable;
volatile u32 thb_write_time;
int escape_count;
} Netlink;

typedef struct
{
char ip[16];
int port;
YabSock sock;
} netlink_thread;

extern Netlink *NetlinkArea;

u8 FASTCALL NetlinkReadByte(SH2_struct *sh, u32 addr);
void FASTCALL NetlinkWriteByte(SH2_struct *sh, u32 addr, u8 val);
int NetlinkInit(const char *ip, const char *port);
void NetlinkDeInit(void);
void NetlinkExec(u32 timing);

#endif

The next one is very long so here is the links
https://github.com/Yabause/yabause/blob ... /netlink.c
https://github.com/Yabause/yabause/blob ... /netlink.h


I think our best bet to implement this with a ras pi would be to get a hold of that yabuse group. I'm thinking they'd be willing to help get this running on raspi's. Seems like everything we'd need is there however Im not a C++/C Programmer :(

But this looks very promising :) Maybe Shu or Kazade can take a look at it eventually ;)

Re: SaturnPi

Posted: Mon Nov 14, 2016 11:09 pm
by itsthinkingstill
from amon on sega xtreme "Best place to find them is in their irc channel on freenode #yabause
"

Re: SaturnPi

Posted: Thu Feb 02, 2017 2:31 pm
by SEGA RPG FAN
Very interesting. Even if the netlink has been emulated in an emulator, you might have trouble getting it to work with real hardware. An emulator can change the way the virtual hardware works to solve some of the issues (not saying that's what they did, but it's a real possibility), you can't change the way a real saturn/netlink works.

Re: SaturnPi

Posted: Thu Feb 02, 2017 2:46 pm
by Xiden
Ultimately if we are able to emulate a Phone Line Simulator via software, we can get the Saturn Netlink to work with a pi. That's really what it comes down to I think.