Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I integrate the link cable into my projects?
#1
Hi there guys, so anyways I was wondering if there was any way to integrate the Ngpc link cable into my projects that are written with the c library? Thanks and have a great day.
Reply
#2
I think someone did a sample project involving the link cable aaaaages ago. Can't find any trace of it in my archive though

Almost certainly not using the framework though
Reply
#3
Check "Plink! v0.01 (2004)(Soft'n Fuzzy)" but it's asm
Reply
#4
I've only got vague glimmers on what to do with a link-game, but do we have any documentation/examples on how to integrate - ASM or not, I think I can fudge that into the framework

Couldn't find any source for plink - the soft-n-fuzzy site has long expired
Reply
#5
(10-07-2025, 03:09 AM)Ahchay Wrote: I've only got vague glimmers on what to do with a link-game, but do we have any documentation/examples on how to integrate - ASM or not, I think I can fudge that into the framework

Couldn't find any source for plink - the soft-n-fuzzy site has long expired

I did some grave digging, and that might help...


Attached Files
.zip   Plink!.zip (Size: 47.05 KB / Downloads: 5)
Reply
#6
Thanks, that's great

Beautifully commented code Smile
Reply
#7
Had more of a look into that plink source and it's missing the .inc files that Steve used Sad
Reply
#8
(06-02-2026, 06:24 PM)Ahchay Wrote: Had more of a look into that plink source and it's missing the .inc files that Steve used Sad

which one ?
I've just checked, and it seems to me they are all in the 'mole' sub folder.
Reply
#9
So it is, thanks for checking - i couldn't see it for looking!
Reply
#10
Okay, so I'm getting into this and I can work out which bits are calling something and which bits are program flow, but I'm not clear on how to check the return values?

For instance - if we look at this bit

Code:
ldb  rw3, VECT_COMCREATEDATA
ldb  rb3,                123
calr             SYSTEM_CALL
cpb  ra3,         COM_BUF_OK
jr    ne,              Again





Right, so we load VECT_COMCREATEDATA(0x13) and the test value 123 into the registers and then call the system_call. We then compare ra3 to COM_BUF_OK and JUMP if NOT EQUAL to the Again label (so,it's a loop)

So, I'm doing that like that 

Code:
    if(wWaitTime1==0)
    {
        u8 again;
        again=0;
    /* Create buffer of four 123 bytes for sending */
        while(again<4)
        {
        // VECT_COMCREATEDATE=0x13
        __asm("ldb  rw3, 0x13");
        __asm("ldb  rb3, 123");
        __asm("calr SYSTEM_CALL");
                __asm("ldb l,ra3"); // Should push the ra3 value to the stack?
        PrintDecimal(SCR_FORE_PLANE,0,0,5,ra3,2);

        if(ra3==COM_BUF_OK)
        {
            again++;
        }
        NegotiateTimeout++;
        PrintDecimal(SCR_FORE_PLANE,0,0,6,NegotiateTimeout,5);
        if(NegotiateTimeout>=1024) again=4;
        }

    }
Edit: So, this is as far I've got - which isn't very far


So far so good, but how do I get the retval from the system call?

Apologies for the stupid questions - I can follow ASM easily enough, but I've only used inline ASM from within C for pretty basic things before
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)