> > I do have ideas on how to implement a bidirectional
> > peer-to-peer link using JoyNet (=2 computers only).
>
> Let's hear it! Supporting more than 2 nodes is a matter of routing, and it
> can be solved in a higher layer.
Not with JoyNet. With more than 2 computers, the databits arrive at a
different computer than Ack does. But it's not very difficult to come up
with something for a ring...
About my protocol: I'll work out an example on my MSX. The basic idea is
like this (I have no implementation experience yet though, so it can still
be changed): The joystickports are checked regularly. A transfer request is
indicated to the peer by flipping ack and setting dat1 and dat2 to 01 or 10,
also flipping each time. Why those values? Well, by default the datapins are
set to 11, and if the peer MSX is disconnected or off, the datapins are 00.
The other then responds, initiating the transfer. The data is transmitted in
4 transmissions on both sides, so 8 in total. If the transfer is
bidirectional, the data of the peer is sent together with the ACKs. The
first two bytes indicate the packet length (excluding the lenght bytes and
the checksum), then the packet is sent, and after the packet a 16-bit
TCP-like checksum (excluding the lenght and checksum bytes) is sent:
"The checksum field is the 16 bit one's complement of the one's complement
sum of all 16 bit words in the header and text. If a segment contains an
odd number of header and text octets to be checksummed, the last octet is
padded on the right with zeros to form a 16 bit word for checksum purposes.
The pad is not transmitted as part of the segment. While computing the
checksum, the checksum field itself is replaced with zeros."
Mind you: one's complement. Not two's complement, neither no complement.
Check your docs on that (Rodnay Zaks' book on the Z80 features a short
description). Short description: when adding data in one's complement, also
add the carry. (so ADD A,r:ADC A,0 is a one's complement addition). In one's
complement, a negative value is indicated by complementing the value. So -1
is FFFE. And -0 is FFFF. But at the same time FFFE is also FFFE (one's
complement doesn't limit to -32768 and +32767 if I'm correct... that's a
tiny bit confusing)... Then complement the final checksum result. When you
receive the data, one's complement add all received words, including the
checksum, and if the result is #0000 then all's well.
Why a one's complement checksum? Check out rfc1071
(ftp://ftp.funet.fi/rfc1071.txt) and be amazed how cool this checksum is!!!
Well that's about it. Simple, eh?
> > However if you have every
> > host connected to two others using a peer-to-peer link (2 computers, so
not
> > really a 'network') in both joystickports (which make it a network
again),
> > then bidirectional transfer is indeed be possible.
>
> The idea of JoyNet was to keep one joystick port free. For example, to
play a
> game using a joystick or game pad.
Yes.
~Grauw
--
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<
email me: [EMAIL PROTECTED] or ICQ: 10196372
visit my homepage at http://grauw.blehq.org/
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<
****
Problems? contact [EMAIL PROTECTED] See also http://www.faq.msxnet.org/
****