Author Topic: Does the Link Port Work in Axe?  (Read 1365 times)

0 Members and 1 Guest are viewing this topic.

Offline ClainBill

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +1/-0
  • Everybody's just a FREAK
    • View Profile
    • My still developing website
Does the Link Port Work in Axe?
« on: June 26, 2023, 05:47:01 pm »
My motivation is fuelled by niche desires, and my current interest is making a multiplayer interactive game (thingy) on two TI calculators that released before I was born because I am partially insane.

Anyways, does it work? I have a TI84+SE and my brother has a TI84+, I have a 2.5mm link cable (I'm not sure where it came from) and yet I can't get any response from either calculator using the Get( Send( or just port commands in Axe.
I also noticed that Multiplayer in the Smash Bros game on doesn't work on my calcs - although I assume that may never have been fully implemented in the first place

I have also tried using Wabbitemu to see if it was my calculators or the link cable that was the issue, but no avail (I do recognise that Wabbitemu could also have not properly implemented the emulated link between calculators or that I am misusing it).

Anyways, any pointers would be appreciated. As a side note I have recently found Google to be profoundly useless as I can no longer find specific pages on forums such as this that I could normally pull from the search engine within seconds - e.g. it literally took me about 30 minutes to find the download to BuilderBoy's Portal Prelude. Something I have been able to locate and download numerous times in the past within seconds. So if there is already some comprehensive post somewhere that has a guide to using the link port that I silly-ly couldn't find, I blame Google
"I don't think I've ever looked in this drawer." (opens it) "Wow, a gun!"

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Does the Link Port Work in Axe?
« Reply #1 on: June 30, 2023, 12:27:56 pm »
@ClainBill
The first question is how sure are you that your link cable is good? I wouldn't be surprised if a cable not designed for linking doesn't work. I had a generic cable years ago (and lost it) but was never able to get it to work. A good way to verify this is using the built-in linking tools. Ti-OS has functions like GetCalc( which lets you send variables from one calc to another over a link cable. Or you could use 2nd-X to open the link menu on both calcs and use that to transfer something. If you can send a variable from one calc to another, the cable and link ports are good. If you can't, then there isn't any point in continuing further.

If you are familiar with assembly, you can use Port 0 and try setting a line low on one calc and see if it is pulled low on the other calc. If you aren't, I can write you some simple hex to use it in Axe once you verify the cable can actually transfer data with Ti-OS.
I'm still around... kind of.

Offline ClainBill

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +1/-0
  • Everybody's just a FREAK
    • View Profile
    • My still developing website
Re: Does the Link Port Work in Axe?
« Reply #2 on: June 30, 2023, 04:50:33 pm »
Oh, I didn't know the I/O port could transfer files as well...
Yeah, that doesn't work. I also have the USB to USB connector, and that successfully transfers files, so it's probably the I/O cable or port.

Okay, so I did some additional testing on wabbit and I have actually got a successful (very crude) link in axe, but the file transfer has the same error my actual calcs have.

I'll use the exact same program on my real calculators and see if I get it working later. Hopefully, my previous implementations were just wrong


*update
hmm, I tested it on the calcs and still no joy. It wouldn't matter that one is an 84+SE and the other is plain 84+ would it?
I guess I just gotta try some real link cables
« Last Edit: June 30, 2023, 05:29:21 pm by ClainBill »
"I don't think I've ever looked in this drawer." (opens it) "Wow, a gun!"

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Does the Link Port Work in Axe?
« Reply #3 on: June 30, 2023, 06:05:36 pm »
@ClainBill
I don't know for a fact that the link port can transfer files. But the Ti-83 has a link menu and no USB port so I assume it can send files over the link port. Looking at some BCALLs, it looks like you can send variables over the link port. Again, I'm not 100% positive, but I can't imagine why a Ti-84+ to Ti-84+ SE link wouldn't work. From the documentation, it seems like the link cable is just 2 lines that either calc can pull low. Since you can put the same OS on a Ti-84+ and a Ti-84+ SE the communication code would be the same. With such basic hardware and identical software, I think it is pretty safe to say that isn't the issue. (And I can't imagine why TI would put a link port on a Ti-84+ if it wasn't compatible with a Ti-83+ too)

Since you have a USB cable, you might be able to do your communications over that. WikiTi is the best documentation you can get for low level stuff like that. There is a lot of ports related to USB and they are poorly documented so unless you really feel like digging, you should probably stick to the link port. If you decide to go for it, I can help you with asm <-> Axe conversions and some guesswork but it will likely be very difficult. But, if you succeed, you could make a super cool Axiom for USB linking for future Axe programmers.
I'm still around... kind of.

Offline ClainBill

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +1/-0
  • Everybody's just a FREAK
    • View Profile
    • My still developing website
Re: Does the Link Port Work in Axe?
« Reply #4 on: July 02, 2023, 05:08:40 pm »
That would be pretty epic if I could get communication over USB, it seems much more capable than I/O, but that's probably outside my league right now.

I ordered a link cable that supposedly was designed for the TI I/O port, so when that arrives I shall do more testing.

Just as a bit of background I just finished my A Levels studying Computer Science which was all in Python, so I don't really have much experience with low-level coding or coding in general, but I have dabbled in C# and (very little) C++, and I've made some basic websites from scratch.

I am planning on learning ASM using the Sean McLaughlin Z80 in 28 Days website.

E37 Can I ask how you learned assembly? Just curious how you got to be so proficient at it. I do think dedicating my time to creating some USB Axiom would be a worthwhile thing, especially as it would benefit future developers whatwith the link cable being so iffy, but I obviously need to learn some asm first  ;D
« Last Edit: July 02, 2023, 05:22:35 pm by ClainBill »
"I don't think I've ever looked in this drawer." (opens it) "Wow, a gun!"

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Does the Link Port Work in Axe?
« Reply #5 on: July 02, 2023, 06:24:54 pm »
The link port can transfer files from a computer with a silverlink cable, as well as between calculators. Calc to calc communication can be a bit tricky at times to get the initial handshake to be happy. At least that's what I remember when sending files between devices in high school. Yes you can transfer between the 83+ and 84+ family as well.
/e

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Does the Link Port Work in Axe?
« Reply #6 on: July 03, 2023, 11:18:07 am »
Just as a bit of background I just finished my A Levels studying Computer Science which was all in Python, so I don't really have much experience with low-level coding or coding in general, but I have dabbled in C# and (very little) C++, and I've made some basic websites from scratch.
I'm not a fan of Python (whitespace as syntax seems insane to me) but from what I can tell without a Googling spree, your project looks really impressive for school. It looks like you understand how to deal with logic which is most of the challenge in learning to program. I have no idea how experinced you are with programming in general. Unless you correct me, I am going to assume that you are experienced enough to be able to code (with Googling as needed) anything you want in high level languages like Python and understand the concept of pointers but haven't worked too much with them.


I am planning on learning ASM using the Sean McLaughlin Z80 in 28 Days website.
That's a good tutorial. But, before you jump into asm, you should make sure that you are very comfortable dealing with pointers and memory. A good way to do so is to make a doubly linked list in Axe. It doesn't need to be efficient but it will force you to work a lot with pointers. The hardest part will probably be allocating memory. A simple way to do that is to allocate a large block of data with GetCalc() and put your list entrys in there, keeping track of free space as you allocate and deallocate list entries. If you can do that, you are ready for asm.


E37 Can I ask how you learned assembly? Just curious how you got to be so proficient at it. I do think dedicating my time to creating some USB Axiom would be a worthwhile thing, especially as it would benefit future developers whatwith the link cable being so iffy, but I obviously need to learn some asm first  ;D
A USB axiom would be less about learning asm and more about figuring out how the USB port works. All you should need is a couple asm snippets that let you read and write to the various ports. Once you have it all figured out (which will almost certainly be very difficult - I counted 31 USB related ports!) there will be time to figure out how to turn it into an Axiom. Here: ':X:Asm(7DD3(123))' writes the lower 8 bits of X to port 123. And ':Asm(DB(123)6F2600)->X' sets X to the 8 bit value read from port 123. In both, the port number can't be a variable. The little documentation that exists for the USB ports is is here. You could also look at USB related BCALLS (and disassemble them) to see how Ti-OS does communication but that would involve learning assembly and trying to figure what Ti was doing when they wrote the OS is not very high on my list of fun activities.

I learned by writing short Asm snippits, converting them to hex and sticking them in my Axe projects. One of the most important tools I had was a little Axe program that took any program and converted its bytes into hex. It is pretty simple to write, just loop over every byte in order, convert it into hex and dump that hex into an output program. I used that program a lot when I was learning asm. Any time I wanted to know how Axe did something, I would make the shortest possible Axe program that did the thing, compile it and then turn that compiled program into hex. I then used this to (manually) decode the hex to actually readable asm. It was very useful for figuring out all the basics. The compiled code that Axe produces is a lot worse than what an experienced asm programmer could make but it also happens to be alot easier to follow the flow of logic since it doesn't do any super advanced tricks. An important thing to remember is that Axe puts all of its built in functions like Pt-On() at the very end of the program (right before data like strings and sprites). Since Axe's built in functions are written in asm and very heavily hand optimized, they are very diffuclt to follow. If you want to see all of Axe's built in functions check out the Developers/Commands.inc file in the Axe Parser download. (shortcut) Some have comments but unless you are looking for something very specific or very general, you probably won't learn much.

When you are debugging, it is super helpful to see register values. If you are programming on the computer, Wabbitemu has some super helpful tools for just that. If not, you can set the value of one of Axe's variables to the value of the register and use Disp to print it out. Just remember that Disp modifies the contents of all the registers so you need to push all the ones you care about before calling Disp and pop them after.

Axe puts the results of its calculations in the HL register. So the line 'X+5' would put the result of X+5 in HL. the line '->X' would store the value currently in HL to X. This is useful as you can do Asm(<some hex>)->X and it would put whatever the final value of HL was in X. The line 'X:Asm(23)->X' Is the same as doing 'X++'. A nice way to verify this is to make an Axe program that is just the line X++ and then disassembling its compiled output. Knowing how to interface with Axe isn't needed when learning but it can make your life a lot easier, especially if you want to skip writing boring calculations in asm or use one of Axe's built in funcitons. Playing around with push hl and pop hl to save variables is a fun starting task and one feature that I think Axe is missing. For example ':X:Asm(E5):SomeFuncitonThatModifiesX():Asm(E1)->X' would let you preserve the value of X. I use that so often in my own Axe code that I made a basic axiom to do just that.

When you are ready to write more complex asm code, Mimas is the best on-calc tool I have found. I did notice that it corrupts the program rarely if you leave it alone for long enough to shut down so make sure to save and quit before leaving your calc. It also comes with handy utilities for converting to and from its internal format and text based asm files you can read and modify on your pc. Of course, there are quite a few PC based tools. I use spasm-ng. (for no other reason than that is what Axe was written in - I didn't do a comprehensive study) Different assemblers may use slightly different syntax for things like macros so if your assembler refuses to compile a some code you found on the internet, that could be why.

Learning asm is not an easy task. Luckily, z80 asm is (in my opinion) one of the easiest ways to learn asm. It has a fairly good suite of instructions without any of the complexities that come with a modern architecture like i386. Schools seem to usually teach RISC based instruction sets which can be easier to learn but are (again, my opinion) much more work to use as they only support a couple very simple instructions. Plus z80 doesn't make you deal with relative addressing that many architectures have. It is important to remember that different architectures have their own quirks and tricks from one may not carry over to another. It was a huge shock going from low level calc programming to low level pc programming. Things like cache and speculative execution take the nice optimization strategy of just counting instruction cycles and throw it out the window and SIMD is there to offer great performance at the cost of learning way more instructions. I have been programming for 8 years and the only constant has always been that me from 6 months ago had no idea what they were doing.

@Xeda112358 is way better at asm than me and might have some suggestions for stuff that I missed.
I'm still around... kind of.