Author Topic: AXE Linking  (Read 8512 times)

0 Members and 1 Guest are viewing this topic.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
AXE Linking
« 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!
I am Bach.

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: AXE Linking
« Reply #1 on: December 14, 2012, 01:04:21 pm »
How are you currently trying to do it?
Nom nom nom

Spoiler For Do a barrell roll:

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXE Linking
« Reply #2 on: December 14, 2012, 01:05:34 pm »
In no way at all... what I currently have crashes P1!

That's why I need help.
I am Bach.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AXE Linking
« Reply #3 on: December 14, 2012, 01:06:33 pm »
This should work :

Code: [Select]
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).
« Last Edit: December 14, 2012, 01:07:19 pm by Matrefeytontias »

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: AXE Linking
« Reply #4 on: December 14, 2012, 01:08:24 pm »
If you leave the time field empty will it go on forever?
Nom nom nom

Spoiler For Do a barrell roll:

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXE Linking
« Reply #5 on: December 14, 2012, 01:16:27 pm »
I just crashed both calcs b/c I don't understand Matrefeytontias's code...

please explain.
I am Bach.

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: AXE Linking
« Reply #6 on: December 14, 2012, 01:18:46 pm »
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
« Last Edit: December 14, 2012, 01:22:07 pm by V1mes »
Nom nom nom

Spoiler For Do a barrell roll:

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXE Linking
« Reply #7 on: December 14, 2012, 03:00:13 pm »
It works! (kinda) Still need a bit of help.
I am Bach.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AXE Linking
« Reply #8 on: December 14, 2012, 04:31:15 pm »
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 ?

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: AXE Linking
« Reply #9 on: December 14, 2012, 04:36:39 pm »
Question, the getcalc (sending command...? ) , also returns a value if failed or completed right?
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AXE Linking
« Reply #10 on: December 14, 2012, 04:43:31 pm »
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.

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: AXE Linking
« Reply #11 on: December 14, 2012, 04:45:54 pm »
Wow sorry mistake on my side xp

But yeah thanks, now i can now how i can do easy synchr... Thx :p
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXE Linking
« Reply #12 on: December 14, 2012, 05:02:26 pm »
My problem: sending 3 vars from one calc, but only 1 from the other.
I am Bach.

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: AXE Linking
« Reply #13 on: December 14, 2012, 05:09:15 pm »
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...
?
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: AXE Linking
« Reply #14 on: December 15, 2012, 04:09:35 am »
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.