[TI Basic] How to make link games in basic
Moderator: MaxCoderz Staff
[TI Basic] How to make link games in basic
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?
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?
-
- Calc King
- Posts: 2195
- Joined: Sun 27 Mar, 2005 4:06 am
- Location: sleeping
- Contact:
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
That's probebly the most annoying thing in BASIC.leofox wrote:Getcalc only works if the other calc is in idle mode (homescreen or input/prompt)
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)
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
Easiest way is to use something like this in your game loop:
Haven't tested this, but it's the theory that counts, not the implementation
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
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
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
- thegamefreak0134
- Extreme Poster
- Posts: 455
- Joined: Mon 23 Jan, 2006 10:09 pm
- Location: In front of a Computer, coding
- Contact:
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 also hear that the 83+SE and 84+SE have issues with the link port, unconfirmed of course. Anyone else know of this?