Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: pimathbrainiac on December 14, 2012, 01:03:17 pm
-
I'm making a new (and better) pong game for the TI-84 in AXE.
I have everything done but linking.
My problem: I need to know how to link in such a way that the calcs are constantly in sync
The vars:
Y - P1 Y coordinate
_theta_ - P2 y coordinate
A - Ball X coodinate
B - Ball Y coordinate
Thanks in advance if you can help!
-
How are you currently trying to do it?
-
In no way at all... what I currently have crashes P1!
That's why I need help.
-
This should work :
0→A→B
Repeat A
Get+1→A
End
Repeat B
Send(your_byte,65535)→B
End
A--
And invert the order of the loops for the other calc. I recommend to make a test at the starting of the program to sync the calcs (like who's pushing [2nd] first).
-
If you leave the time field empty will it go on forever?
-
I just crashed both calcs b/c I don't understand Matrefeytontias's code...
please explain.
-
The first loop waits until a byte is received. Then when it is it adds 1 to it and stores it to A.
The second loop loops until it has sent your_byte.
Then A-- subtracts the one added to A at the end of the first loop restoring the sent value. Hope this helps.
On second thoughts you could have the loops as subs then you would have more control over the order they are called in
-
It works! (kinda) Still need a bit of help.
-
In fact, Get returns -1 if no byte was found, so I add it 1 and store it to A so if no byte was found, A is 0 and the loop repeats.
What are you having trouble with ?
-
Question, the getcalc (sending command...? ) , also returns a value if failed or completed right?
-
GetCalc() is the function to accesas an OS var in Axe. You send a byte with the command Send(byte, time), which returns zero if failed or non-zero otherwise.
-
Wow sorry mistake on my side xp
But yeah thanks, now i can now how i can do easy synchr... Thx :p
-
My problem: sending 3 vars from one calc, but only 1 from the other.
-
Hmmm, let the routines on the two calcs be different... So routine 1.1 = 3 sends... Routine 2.1 = 3 gets
Routine 1.2 = 1 get. Routine 2.2 = 1 send
Where 1.1 and 1.2 are for the calc that sends 3 vars
And 2.1 and 2.2 for the other calc...
?
-
You can't send/receive a different number of bytes between 2 calcs. You always have to send and receive the same number of bytes, so if you want to send 3 bytes and receive 1, make the second calc send useless bytes as 2nd and 3rd to keep the calcs in sync.
-
You can't send/receive a different number of bytes between 2 calcs. You always have to send and receive the same number of bytes, so if you want to send 3 bytes and receive 1, make the second calc send useless bytes as 2nd and 3rd to keep the calcs in sync.
That is not necessarily true, with the right linking protocol you can send any number of bytes in either direction. I wrote a basic tutorial on linking a while ago but I think it got lost D:
-
Hey, For a different game, I'm doing a test for the engine with the link port.
It's not working... I think it's because I'm using the USB port, but does that actually make a difference in the code?
-
Ow, USB has nothing to do with the port D:
-
Crap! I'm going to have to borrow a cable from a math teacher at my school...
-
If the gCn axiom can't allow you to deal with the USB port, nothing will do (at least with Axe). I'm even not sure ASM can do something with the USB port without a host (and then the calc to be slave).
-
Well, I hope I can get that working... Does it work with a direct link???