Subject: Re: USB joystick with VICE?
To: Jukka Marin <jmarin@embedtronics.fi>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: netbsd-users
Date: 01/05/2004 11:05:16
Jukka Marin <jmarin@embedtronics.fi> writes:

> I was wondering if I could use a USB joystick with the C64 emulator (VICE)
> under NetBSD.  So I went and bought myself a Logitech Attack 3 stick (the
> cheapest I could find :-) and plugged it in:
> 
> uhidev1 at uhub1 port 2 configuration 1 interface 0
> uhidev1: Logitech Logitech Attack 3, rev 1.10/0.10, addr 3, iclass 3/0
> uhid0 at uhidev1: input=5, output=0, feature=4

That's normal for a USB joystick (or wheel, or other generic
knobs-and-buttons-and-switches HID device).

> And that's about it.  VICE says it can't open /dev/joyN.  Is it possible
> to use a USB joystick?  Somehow?  Please? :-)  We do have a real C64 and
> two C128's, but still, VICE works quite well and only lacks a joystick..

VICE only knows about the old-style joystick interface; it needs some
code written to handle USB controllers (including, sadly, some
mechanism to pick which joystick/pad to use for what, and which
buttons map where). The interface to use is the stuff in libusbhid;
see usbhid(3). You can probably crib from XMame's USB joystick
support, in that package's src/unix/joystick-drivers/joy_usb.c.

        - Nathan