Re: Keyboard adapter

Shaun Jackman <[email protected]>
Newsgroups gmane.linux.ports.game-cube.devel
Message-ID <[email protected]>
On 5/1/05, Daniel Thompson <[email protected]> wrote:
> On Sat, 2005-04-30 at 17:36 -0700, Shaun Jackman wrote:
> > I have a PS/2 keyboard to GameCube joystick port adapter labelled "GC
> > Keyboard & PS Controller Adapter 2 in 1 for GameCube". It works with
> > Action Replay and Phantasy Star Online, but I haven't managed to get
> > it working with Linux. Does this device work with GC Linux? I'm
> > running Linux 2.6.11-isobel-nfs9.
> 
> Try the attached patch.

Thanks for the patch. I haven't yet compiled my own GC kernel, but as
soon as I have I'll get back to you.

In the following line, the right-hand-side is identically zero. 

  		key[2] |= (raw[1] << 28) & 0xFF;

From the surrounding code, I'd guess a right shift was intended.

  		key[2] |= (raw[1] >> 28) & 0xFF;

This would mean though that the bits decoded by key[2] and key[3] overlap.

 		key[2] = ((raw[0] << 4) & 0xFF) | ((raw[1] >> 28) & 0xFF);
		key[3] = (raw[1] >> 24) & 0xFF;

If we label raw[1] as bits 0..31 and raw[0] as bits 32..63 we have

	key[0] = bits 44..51
	key[1] = bits 36..43
	key[2] = bits 28..35
	key[3] = bits 24..31
	key[4] = bits 16..23
	key[5] = bits 8..15

This table shows the overlap of bits 28..31, as well as the undecoded
bits 0..7 and 52..63. Is there any information transmitted in those
undecoded bits?

Cheers,
Shaun


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.