Author Topic: Link Port  (Read 10993 times)

0 Members and 1 Guest are viewing this topic.

SirCmpwn

  • Guest
Link Port
« on: October 28, 2010, 07:03:20 pm »
Hello,
How do I access the link port on the Nspire?  It's documented here: http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports#90100000_-_TI-84_Plus_link_port, but this doesn't seem to work.

SirCmpwn

  • Guest
Re: Link Port
« Reply #1 on: October 29, 2010, 08:29:20 am »
*bump*

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Link Port
« Reply #2 on: October 29, 2010, 08:53:47 am »
I suppose currently only calc84maniac or Goplat have any knowledge on this.
Ndless.me with the finest TI-Nspire programs

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Link Port
« Reply #3 on: October 29, 2010, 05:21:35 pm »
I think even Calc84maniac doesn't, but again, I could be wrong. Maybe you might have more luck with Goplat.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Link Port
« Reply #4 on: October 29, 2010, 05:36:39 pm »
I guess it would mean you read/write those memory locations to control the port, like it said. INitilaize a pointer to it, and then modify the value. Haven't tried anything with it, though.

SirCmpwn

  • Guest
Re: Link Port
« Reply #5 on: October 29, 2010, 06:02:07 pm »
Quote from: calc84maniac on Cemetech
Well, at that point, I didn't know how to access the TI-84+ link port through ARM assembly. Now I do, but I no longer have the source code for the TI-83+ emulator.
Now I'm just hoping he notices :P

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Link Port
« Reply #6 on: October 29, 2010, 08:16:29 pm »
Oh, I thought he kinda moved on from the idea for a while or was still working on it. I knew about his lost source code, though.

SirCmpwn

  • Guest
Re: Link Port
« Reply #7 on: October 30, 2010, 01:29:38 pm »
Calc84maniac and I were chatting last knight about how to fix this, and this is how you do both of our issues:
Access the link port:
To enable the link port, OR the value at 0x900A0000 with 0x20.
To disable, AND the same value with ~0x20.
Change the first two bits of 0x90100000 to reflect the state of the ring and tip, respectively.
Interrupts:
Back up the value at 0x38 first.
Load your own interrupt function into 0x38 by using &functionname to get a pointer to it.
Restore 0x38 upon leaving.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Link Port
« Reply #8 on: October 30, 2010, 01:55:58 pm »
Access the link port:
To enable the link port, OR the value at 0x900A0000 with 0x20.
To disable, AND the same value with ~0x20.
Actually, that should be 0x900A0004. That could explain why nothing was happening.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

SirCmpwn

  • Guest
Re: Link Port
« Reply #9 on: October 30, 2010, 02:11:21 pm »
That would be a great explanation :P

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Link Port
« Reply #10 on: October 30, 2010, 02:13:44 pm »
This is to use the I/O link port when in Nspire mode, after swapping the keypads, right? Has anyone gotten any success with the USB?
« Last Edit: October 30, 2010, 02:14:31 pm by DJ Omnimaga »

SirCmpwn

  • Guest
Re: Link Port
« Reply #11 on: October 30, 2010, 02:26:10 pm »
I haven't tried USB, and this is intended to use the I/O port on an 84+ keypad.
okay...
Sounds weird but I'll go with it.
I got sound to work now, it plays a tone, and pressing up and down on the keypad changes the tone.
The following code should play some sort of noise, but it only plays a high pitched tone:
Code: [Select]
int main(void) {
enableLink();
clearScreen();
FILE* wavFile = fopen("HBFS.wav", "r");
char currentSampleLeft, currentSampleRight;
while (!isKeyPressed(KEY_84_ENTER))
{
}
while (!isKeyPressed(KEY_NSPIRE_ESC) && !isKeyPressed(KEY_84_CLEAR))
{
fread(&currentSampleLeft, 1, 1, wavFile);
fread(&currentSampleRight, 1, 1, wavFile);
int count;
for (count = 0; count <= 0xFF; count++)
{
int value = 0;
if (count < currentSampleLeft)
{
value++;
}
if (count < currentSampleRight)
{
value += 2;
}
KEYPAD_84_IO = value;
}
}
fclose(wavFile);
disableLink();
return 0;
}

void enableLink()
{
MISC_PORTS |= 0x20;
}

void disableLink()
{
MISC_PORTS &= ~0x20;
}
Any ideas?
« Last Edit: October 30, 2010, 03:24:04 pm by SirCmpwn »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Link Port
« Reply #12 on: October 30, 2010, 11:56:41 pm »
Oh wow you're trying to get sound to work? O.o

I hope you can get it figured out. Hopefully someone will be able to help soon.

SirCmpwn

  • Guest
Re: Link Port
« Reply #13 on: October 30, 2010, 11:57:39 pm »
Well, right now what I have is static with the faintest inklings of the occasional tone, so I have a long way to go.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Link Port
« Reply #14 on: October 31, 2010, 04:33:02 am »
Yeah I know. I hope you can eventually manipulate sound and stuff, even if it's just to produce sound like this ;D :