Netlink

From Yabause
Jump to: navigation, search
North American Netlink Cartridge

The Netlink is essentially a stripped down modem used by about a dozen games to do multiplayer over a telephone line. It was only released in North America and supposedly a limited release in Europe.

The hardware itself is based on the RC288DPi Rev 05BA chipset by Rockwell(who are Conexant now). Maximum connection speed is 28800 bps. There was also a web browser that came with it called Planetweb.

For the most part it's accessed pretty much the same as a regular PC modem, with a few odd exceptions.

Memory Mapping

It's mapped on the A-bus CS2 area along with the CD block(it's pretty much mapped every area the cd block isn't). For the sake of simplicity, here's a list of the addresses used by developers.

Address Netlink register description
0x25895001 Receive Buffer Register(RBR)/Transmit Holding Register(THR)/Divisor Latch LSB(DLL)
0x25895005 Interrupt Enable Register(IER)/Divisor Latch MSB(DLM)
0x25895009 Interrupt Identification Register(IIR)/FIFO Control Register(FCR)
0x2589500D Line Control Register(LCR)
0x25895011 Modem Control Register(MCR)
0x25895015 Line Status Register(LSR)
0x25895019 Modem Status Register(MSR)
0x2589501D Scratch Register(SCR)
0x2582503D ???(For some reason, you need to write 0xFF to this address after each modem register access)

The X-Band Modem has the same set of registers, but they appear to be mapped at 0x25895021-0x25895039 instead.

Normally, to use it, you first have to send command 0xA to the SMPC. This "turns on" the modem. After that, it's best to write a byte to the Scratch Register, then read it again afterwards to make sure it is indeed on.

After being being turned on, the registers return as follows:
RBR: 0x00
DLL: 0x00
IER: 0x00
DLM: 0x00
IIR: 0x01
LCR: 0x00
MCR: 0x00
LSR: 0x60
MSR: 0x30
SCR: 0x01

After initializing everything, you use it like a regular modem. To receive interrupts from the modem, enable SCU external interrupt 12(vector 0x5C).

Initializing the Netlink

In order to initialize the Netlink, the SMPC has to turn it on via SMPC command 0xA. After that, the SCR register should be written to and read to verify that it's working correctly. You may also want to setup a separate buffer to buffer data from the receive buffer.

The code below should initialize the Netlink properly:

int Init_Netlink(void)
{
   SmpcWaitTillReady();
   // Make sure Netlink is off first
   SmpcIssueCommand(0x0B);

   SmpcWaitTillReady();
   // Now turn it on
   SmpcIssueCommand(0x0A);

   // The following may not be necessary, but all games using the Netlink did it
   if (ReadSCR() != 0xA5)
      return 0; // return error

   return 1; // return ok
}