#153046 - thoduv - Mon Mar 24, 2008 4:14 pm
Hello,
I'm currently trying to make my Wii and my GBA to communicate via GC/GBA link cable.
On the Wii side, I'm doing simple polls to retrieve the GBA device type:
Code: |
SI_GetType(1); // (gba is plugged on port 1, there's no mistake here :D ) |
On the GBA side, I set the GBA in Joybus mode, enable serial interrupt, but nothing happens: I don't receive any reset-command from the GC, and the serial irq never occurs.
I've tried other things, such as polling REG_JOYRE, ack'ing bits in REG_JOYCNT, etc.
Register JOYSTAT stays set on 0x0008 (bit 4 set: "GBA is sending", though I didn't send anything).
Code: |
REG_RCNT = R_JOYBUS;
REG_JOYCNT = (1 << 6); // enable irq
irqSet(IRQ_SERIAL, Serial_Event);
irqEnable(IRQ_SERIAL);
|
Has anyone once managed to get this joybus mode to work ?
Thanks !
#153054 - Maximus32 - Mon Mar 24, 2008 4:46 pm
Have you initialized interrupts on the gba?
#153056 - thoduv - Mon Mar 24, 2008 5:02 pm
Maximus32 wrote: |
Have you initialized interrupts on the gba?
|
Yes, and vblank/timer irq works.
#153106 - eKid - Tue Mar 25, 2008 12:50 am
Does SI_GetType(1) send a reset command? Also, gbatek says (for JOYSTAT)
GBATEK wrote: |
Bit 3 is automatically reset when reading from local JOY_RECV.
|
Bit3 means there's a transfer in progress, or a transfer has finished. Read the data from JOY_RECV. :P
Notice the keyword in the description for bit3 in JOYSTAT:
Code: |
3 Send Status Flag (1=Remote GBA is/was sending) (Read Only?)
|
I guess the "remote gba" is actually the gamecube.
#153122 - Maximus32 - Tue Mar 25, 2008 9:07 am
Done some experimenting here with the same results. The flag indicates data is/was received from GameCube/Wii (even if the connector is not plugged in). Reading the data from JOY_RECV has no effect, the data read is always 0, and the flag remains high.
Perhaps the bits are only valid when both sides have set up joybus mode? What mode is the GameCube/Wii in? And does libogc support joybus? The gba can be set up in 5 different modes but I can't find anything on how to set up the GameCube/Wii?
#153129 - eKid - Tue Mar 25, 2008 1:04 pm
There's also bits in JOYCNT that tells you if receiving/sending data was actually completed.
#153150 - thoduv - Tue Mar 25, 2008 6:51 pm
Gamecube controller port are joybus-only port, and the SI module of libogc communicate with joybus devices such as gamecube controller.
As for SI_GetType(1), I think it send a reset command, because the slave must answer its type to a reset command, but I can't figure it, since I can't understand the SI source from libogc.
I'll do experiments with the "raw" SIO mode on GBA, to see if anything comes from the Gamecube.
#153173 - tepples - Wed Mar 26, 2008 12:09 am
I tried the raw SIO once. I was able to see requests from the GameCube, but I couldn't figure out the timing for replying. Maybe it's because I have no access to a logic analyzer.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#153764 - bluesceada - Sat Apr 05, 2008 6:49 pm
You have to get down to 1us ... quite hard or impossible with 16mhz, programmed in C
Do you already know this?:
http://www.int03.co.uk/crema/hardware/gamecube/gc-control.htm
and I would try general purpose mode of the gba link port, I heard that in Joybus mode some things are automatized... and not all is known about it
#153896 - tepples - Tue Apr 08, 2008 12:49 am
bluesceada wrote: |
You have to get down to 1us ... quite hard or impossible with 16mhz, programmed in C |
If I had a logic analyzer, I'd be counting cycles in assembly language.
Yes, that's one of the documents I read.
Quote: |
and I would try general purpose mode of the gba link port |
I was using general purpose. That's what I meant by "the raw SIO".
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.