On 5/1/05, Daniel Thompson <daniel@...> 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.
>=20
> 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.=20
=09=09key[2] |=3D (raw[1] << 28) & 0xFF;
From the surrounding code, I'd guess a right shift was intended.
=09=09key[2] |=3D (raw[1] >> 28) & 0xFF;
This would mean though that the bits decoded by key[2] and key[3] overlap.
=09=09key[2] =3D ((raw[0] << 4) & 0xFF) | ((raw[1] >> 28) & 0xFF);
=09=09key[3] =3D (raw[1] >> 24) & 0xFF;
If we label raw[1] as bits 0..31 and raw[0] as bits 32..63 we have
=09key[0] =3D bits 44..51
=09key[1] =3D bits 36..43
=09key[2] =3D bits 28..35
=09key[3] =3D bits 24..31
=09key[4] =3D bits 16..23
=09key[5] =3D 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
|