A STANDARD FOR JOYSTICK-COMMUNICCATION proposal...
==================================================

I have a proposal about a standard for joystick-connections. Read below
about what way I had in mind to let it work like. It is meant to be put in
Joystick-port 2 of both computers.

If you ppl are enthousiastic about this I will program a universal engine
for it which will, ofcourse, be freeware. If you have any ideas or
improvements, please reply!!! The current plan works in 6 steps, with
checksum included.

Take a look at it and let me know if you agree to this and are willing to
use it as standard.


My idea was to connect both joystick-connectors like this:
=============================================
pin 6 : 1   (trig1 > fwd)
pin 7 : 2   (trig2 > back)
pin 8 : 3   (output > left)


This is the way the engine of the joystick connection should work, both
computers should use the same routine:
=======================
Data
- input: pins 1 and 2 (2=MSb)
- output: pins 6 and 7 (7=MSb)
- Transfer Ready (TR) input=pin 3  /  TR output=pin 8
- RQ=set pin 7 to 1 if you want to send a byte.
- Parity (checksum): standard flag of the Z80. Used as a checksum to
  test if all bytes are transferred correctly. If the number of ones in the
  byte is odd, then the P-flag will be 0. Is the number of ones even, then
  P will become 1.

=== Main 'routine'.
Initialization
- Check if there is a connection and if so, establish a connection and
  let the computers decide which one is the master/slave...

=== Loop this until there are no bytes to be read/send anymore.
Wait for Transfer-Ready and read status-bytes.
- Send 1 to TR-output and set RQ-bit and (if RQ is set) the Checksum-bit.
- Wait for the TR-input to become 1 too. Read RQ and the Checksum.

If RQ input=1 then read a byte. If RQ output=1 then send a byte.
If both computers have set RQ, the 'master' may send first.

:Send a byte...
:- Send 2 bits of the byte and complement TR-output.
:- Wait for TR-input to become it's complement.
:- Repeat this 4 times.
:- Wait for the TR-bit to complement again and then test if the inputbits
:  accompanied with it are 11. If so, then there was a checksum-error
:  and the byte has to be send again.
:
:<<<------------------------- OR OR OR ------------------------->>>.
:
:Read a byte...
:- Wait for TR-input to become it's complement.
:- Read 2 bits of the byte and complement TR-output.
:- Repeat this 4 times.
:- Check the byte (using AND A and comparing the Checksum with the
:  Parity-bit in the F-register). If incorrect, set both outputbits to one.
:  If correct, set both outputbits to zero.
:  Complement TR again.

Loop


~Grauw


****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to