NetBSD Problem Report #29900

From  Wed Apr  6 07:38:47 2005
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 7010163B121
	for <>; Wed,  6 Apr 2005 07:38:46 +0000 (UTC)
Message-Id: <>
Date: Wed, 6 Apr 2005 09:38:40 +0200 (MEST)
Subject: vice does not recognize firebutton of Competition Pro USB
X-Send-Pr-Version: 3.95

>Number:         29900
>Category:       pkg
>Synopsis:       pkgsrc/emulators/vice/ does not recognize firebutton of Competition Pro USB joystick
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kristerw
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 06 07:39:00 +0000 2005
>Last-Modified:  Fri Apr 08 09:39:03 +0000 2005
>Originator:     Bernhard Moellemann
>Release:        NetBSD 3.0_BETA and NetBSD 2.0


System: NetBSD arcanic 3.0_BETA NetBSD 3.0_BETA (ARCANIC) #0: Fri Apr 1 11:04:53 CEST 2005 root@arcanic:/mnt/root/usr/src/sys/arch/i386/compile/ARCANIC i386
Architecture: i386
Machine: i386

The C64 Emulator pkgsrc/emulators/vice does not recognize the firebuttons
of the (since january available) Competition Pro USB joystick. This happens
because hid_get_item(3) reports 255 as hid_item.logical_maximum and vice
expects at least 1/3 of the logical_maximum to be reached to emulate a
digital joystick but the joystick gives only 1 if the button is pressed.

I do not know, if the joystick reports broken numbers or if hid_get_item(3)/
hid_get_data(3) reports faulty values or vice is overoptimistic in its
assumptions about buttons. So I report this here, hoping somebody can
figure out what exactly is broken.

The same happens with NetBSD 2.0.


Compile Vice out of the pkgsrc, plug in an Competition Pro USB joystick,
select USB Joystick in Vice and start any game which uses the joystick:
The axis work fine, but none of the four firebuttons works.

With this patch applied the Competition Pro USB works. But I do not now
if this breaks other joysticks/input devices, because I own only this
one joystick. So testing is recommended before committing it.

--- src/arch/unix/joy_usb.c.orig	2004-08-07 21:33:32.000000000 +0200
+++ src/arch/unix/joy_usb.c	2005-04-01 12:37:26.000000000 +0200
@@ -109,7 +109,7 @@
 	it->min_or = 0;
 	it->min_val = -1;
 	it->max_or = orval;
-	it->max_val = hi->logical_maximum-1;
+	it->max_val = 0; /* hi->logical_maximum-1; */

     case ITEM_HAT:

Reminder: Test it with other joysticks 8-)



Responsible-Changed-From-To: pkg-manager->kristerw
Responsible-Changed-When: Fri, 08 Apr 2005 09:39:03 +0000
kristerw is the maintainer.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.