A86: Re: Linking Routines


[Prev][Next][Index][Thread]

A86: Re: Linking Routines




The GetByte and SendByte routines should work perfectly on the 85, and would
probably work just fine on the 82/83.  Since they practically ARE the
routines from ZTetris, I for a fact that they will interface with the
routines used in the 82/83 verions.

I've never seen a good explanation on how they work.  They were originally
written by Pascal Bouron and are very nice (except for timing out once in a
while, but that's probably the calcs fault :)  Link routines are the one
exception, imho, to the rule that you should understand all code in your
program.  If you want to know how the link port works, check out 86 Central
or one of the many TI sites (including TI's 83 asm info).

I think that linking is kind of complicated.  Since it works with bits, you
must deal with sending and receiving bits by turning on and off the
individual wires, along with converting them to bytes, hand shaking, error
checking, etc.  If such a routine exists, whether in the archives or at
ticalc.org or in the calc's rom, I'll use it.

To send tables of data, just call the routine in a loop:

  ld hl,Table     ; point to table
  ld b,64         ; 64 bytes to send
loop:
  ld a,(hl)       ; get byte from table
  call SendByte   ; send the byte
  jr c,Error      ; there was an error, so handle it
  inc hl          ; next byte
  djnz loop       ; send all bytes

This may not work for you, you might have to play with it a little.  I
didn't test it, of course.  I released a little linking demo, Outlaw, to the
list a while back.  It demonstrates moving linking up, deciding which player
is which, showing the other player's movements, handling weapons firing and
movement, along with basic sprite draw, handling and collision checking.
Since I never tested playing it until the next day, I didn't find out that
it was getting out of synch (I think I was sending too much data each
frame...that's one thing you have to think about), which is why I say it's
just a demo and not a game.  After playing for a bit it freezes (just
freezes the movement, exit still works, but you can't keep playing).  Yes,
multiplayer game programming IS complicated, especially real time.  I wonder
how you do it on the Game Boy.  Now, why couldn't TI have given us nice snap
in link connectors instead of these dumb pins that always bend and break
off?

--
David Phillips <david@acz.org>
http://www.acz.org/

----- Original Message -----
From: <Jkhum98@aol.com>
To: <assembly-86@lists.ticalc.org>
Sent: Friday, January 15, 1999 7:50 PM
Subject: A86: Linking Routines


>
>I need some assistence on learing how to use Linking Routines.  First of
all,
>are the Sendbyte and Getbyte Routines from ACZ too 86 specific?  I would
like
>to use them across all of the z80 calcs for the TCPA Battleship project I'm
>working on... Well, I understand the input and output of these routines,
but I
>cant really grasp the concept of the linking yet... :\  How do the calcs
know
>which byte was transmitted, and how to store it to its corrosponding spot
in
>the two 64 byte tables i need transferred.  How is the data being
>sent/received, timed and lined up...? Somebody please give me an
explanation
>on how this works... I dont want to hear "Go check out the Ztetris Source"
>though... =P  Also, get very technical about how the ports work, if you
>must... Thanks in advance, anybody... =)
> --Jason K.
>