[TI Basic] How to make link games in basic

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Gert-Jan
New Member
Posts: 42
Joined: Mon 06 Feb, 2006 5:18 pm

[TI Basic] How to make link games in basic

Post by Gert-Jan »

Hi, i just tried making a little link-game in basic, but it seems there is some kind of bug in the linking system.
Just try this
Calc 1:
While 1
1->A
End

Calc 2:
0->A
While 1
Get(A)
Disp A
End


What you will see is that calc 2 displays all the time 0, and doesnt get the A from calc one. Is there any way to solve this? or do i have to call for little ASM-progs in my basic prog, that do the linking for me?
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I was under the impression that Get and Send were used for CBR/CBL apps. GetCalc ought to work.
Image
Gert-Jan
New Member
Posts: 42
Joined: Mon 06 Feb, 2006 5:18 pm

Post by Gert-Jan »

no, i tried it, still doesnt work.
leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Post by leofox »

Getcalc only works if the other calc is in idle mode (homescreen or input/prompt)
Image
Image
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

leofox wrote:Getcalc only works if the other calc is in idle mode (homescreen or input/prompt)
That's probebly the most annoying thing in BASIC.
If the other calc is doing anything at all (and it usually is in games) it will fail.

so gert-jan you'll have to use ZCOM or any other asm program that will do the linking for you, or be creative and use omnicalcs LinkGet( and LinkSend( to send 1 byte at a time. (this really isn't the fastest way, but when you only have to send values between 0 and 255 it might be a good idea)
User avatar
Saibot84
New Member
Posts: 38
Joined: Fri 17 Feb, 2006 9:14 pm
Location: Jersey City, NJ

Post by Saibot84 »

actually, i believe executing a "Pause" on one calc is enough for it to be considered in "idle" mode... so you will have to "Pause" in order for the calc to be able to send any data to the other calc
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

That isn't practical in games though. Actually it isn't practical anywhere (well except some sort of BASIC file transfer programs)
Gert-Jan
New Member
Posts: 42
Joined: Mon 06 Feb, 2006 5:18 pm

Post by Gert-Jan »

ye, that isnt possible in games then, what should be the best solution?
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

CLAP, ZCOM, usb8x, or even the Omnicalc sendbyte if you only have to send a few bytes anyway
Gert-Jan
New Member
Posts: 42
Joined: Mon 06 Feb, 2006 5:18 pm

Post by Gert-Jan »

ok, will try this in the morning. TY
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

I'm moving this to Programming Help, since that's where it belongs.
Image
Gert-Jan
New Member
Posts: 42
Joined: Mon 06 Feb, 2006 5:18 pm

Post by Gert-Jan »

ok, sry, didn't know i putted it wrong
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Easiest way is to use something like this in your game loop:

Code: Select all

"SWAP A BYTE IN B BETWEEN 2 CALCS
"EXPECTS CALC# IN A
If A=1
Then
B->W
1->V
Asm(prgmZCLAP
0->V
Asm(prgmZCLAP
W->B
Else
0->V
Asm(prgmZCLAP
B->V
W->B
V->W
1->V
Asm(prgmZCLAP
End
Return
Haven't tested this, but it's the theory that counts, not the implementation :)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Getcalc works if the other calc is at a Pause command, then it resumes the other calc.
You know your hexadecimal output routine is broken when it displays the character 'G'.
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

I have a nice little tutorial for calc linking, sort of. I lost it and the link, but it basically shows a nice loop between the two where you do nothing on one and it still sends the data. Whenever you getcalc on one calc, if the other is in pause mode and it sends the data, ut un-pauses (resumes as mentioned above) and continues on it's merry way. Think of this as a "wait to send my data" sort of thing. My theorey has always been to send a byte, then get a "confirmation" byte from the other end to make sure the data was recieved.

I also hear that the 83+SE and 84+SE have issues with the link port, unconfirmed of course. Anyone else know of this?
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
Post Reply