From nobody Wed Apr 12 10:57:29 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PxKRZ39m5z44XbK; Wed, 12 Apr 2023 10:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PxKRZ2n0zz4HhT; Wed, 12 Apr 2023 10:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681297050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BQZA8ZUoYYk1rChWoNi5gpbyY78sx3KG/gx898vV1vs=; b=UfNtnE/0vV9sjKbTwjNP17pDpvRQYvZAEUSW/1JJeZZTxSWJLwzzZyE07KHBhEp78aw9Rt /sQKSfE8YjcY8GF8cbnOcjWyW/sXpybtcE4X/JxYfauVkpUsmOGkrBDNv2rwalkORgzMS/ xmgwygd4tKCflMFuDjuE73z680XnZG9HooA+l7aMneA1N+h3i+wlKMaelTZ5BjKV500PU/ w+dyVXXUUeql+4iEtMGQ/G+Gr8Ldt73GMc2UfZDghqdCp03I+NDnE88Bv7xu5pF7dKu+Bk HCYAsIBAhLQBBc4fV6WrVLdkOGedyGE+pykUUT2EselOdYOEbLs/F0ybeutnsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681297050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BQZA8ZUoYYk1rChWoNi5gpbyY78sx3KG/gx898vV1vs=; b=LAOzTXglINGEPeEG09e7TCN8qAkKRol43JtWJ9E075DAN8qP23at1HUI+uZAdqWfiBxoYd y2/m9YWOxvzyTU39WCIMy8Qwm3s51AKSU+/aOQpJRD1bifMX5aP5FlbiSaC88yEPXzGE88 Ty4PAHAGobzb1r4J6PO6Uv+/zN/FELOlLJpWAYWJwM0M2WYPxFGlPY0msS3TWEqCcLDOXE kSbQNIPTIQ+5Z+ySZrxVf4FC36XDTRRP6iiq6PqHQ5SX9PYnyItcD44dy2tSDIB6ssJXbX jZrZyf/R1nRnN2GPYCsXeuPjT9uBVpG7i0OJMSIQBWpuhGUIv7rNWYeHGcEfhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681297050; a=rsa-sha256; cv=none; b=LHMXwWP1JvVSkpszLzQK72NGo2kTxuRb9/xE9EWrpZYRZWCIeojVeJvyPkY2wqJU0e5umM PHfsf8jNAhQmNvSfYDRimnP6oIOYRv1S3t/Q2pbhKDXFm+81z/FDPIFIJP/6DAsQHSiL+H V4XEMhAwxR56Qz6qiTqmHztsUoItcAzEA02p83lM2rvOf0K8vxQLX3gGIDoQHzRlnINYmQ LsxJAitapsabhAtYFOcJTYK6OXPK8gwRis8Wk9gLFL/pIn8RALV2IIOCtuLqIsS2wGqZ/E S922YI/1qNQOZEH7nl8YBXD0c01V4II5U0aNanUoUSXquM3nihXAb8lNHK+kXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PxKRY70Rhzx7G; Wed, 12 Apr 2023 10:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33CAvTMn040665; Wed, 12 Apr 2023 10:57:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33CAvTXs040664; Wed, 12 Apr 2023 10:57:29 GMT (envelope-from git) Date: Wed, 12 Apr 2023 10:57:29 GMT Message-Id: <202304121057.33CAvTXs040664@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Ganael LAPLANCHE Subject: git: 17391201101f - main - games/flightgear: Improve joystick hat management List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: martymac X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17391201101f313c2c9049fea8e336acfee43d92 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by martymac: URL: https://cgit.FreeBSD.org/ports/commit/?id=17391201101f313c2c9049fea8e336acfee43d92 commit 17391201101f313c2c9049fea8e336acfee43d92 Author: Stephen Hurd AuthorDate: 2023-04-12 10:47:02 +0000 Commit: Ganael LAPLANCHE CommitDate: 2023-04-12 10:52:33 +0000 games/flightgear: Improve joystick hat management Do not hardcode the hatmap but derive values from HID data (based on HID1.1 spec), and if the HID data is unexpected, fall back to the old values. That patch fixes support for Logitech Extreme 3D Pro joystick's hat. PR: 270676 Reported by: shurd Tested by: shurd --- games/flightgear/Makefile | 1 + .../files/patch-3rdparty-joystick-jsBSD.cxx | 77 +++++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/games/flightgear/Makefile b/games/flightgear/Makefile index 5a0068fb1d08..f955cf419c59 100644 --- a/games/flightgear/Makefile +++ b/games/flightgear/Makefile @@ -1,5 +1,6 @@ PORTNAME= flightgear PORTVERSION= 2020.3.18 +PORTREVISION= 1 CATEGORIES= games MASTER_SITES= SF/flightgear/release-${PORTVERSION:R} diff --git a/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx b/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx index 115d2bd2db8b..299a4933f9c7 100644 --- a/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx +++ b/games/flightgear/files/patch-3rdparty-joystick-jsBSD.cxx @@ -1,4 +1,4 @@ ---- 3rdparty/joystick/jsBSD.cxx.orig 2020-05-28 21:56:43 UTC +--- 3rdparty/joystick/jsBSD.cxx.orig 2023-04-07 17:57:15 UTC +++ 3rdparty/joystick/jsBSD.cxx @@ -52,6 +52,7 @@ #include @@ -8,3 +8,78 @@ #include #include #include +@@ -198,6 +199,8 @@ static int joy_initialize_hid(struct os_specific_s *os + interesting_hid = TRUE; + if (page == HUP_GENERIC_DESKTOP) + { ++ int range; ++ int matched; + switch(usage) { + case HUG_X: + case HUG_RX: +@@ -221,6 +224,65 @@ static int joy_initialize_hid(struct os_specific_s *os + (*num_axes)++; + os->axes_usage[*num_axes] = usage; + (*num_axes)++; ++ } ++ range = h.logical_maximum - h.logical_minimum + 1; ++ matched = 0; ++ if (((h.logical_minimum == 0) || (h.logical_minimum == 1)) && (h.unit == HUM_DEGREE) && (h.unit_exponent == 0) && ((range == 4) || (range == 8))) { ++ int resolution = (h.physical_maximum - h.physical_minimum) / (h.logical_maximum - h.logical_minimum); ++ for (int i = h.logical_minimum; i <= h.logical_maximum; i++) { ++ const int degrees = (i - h.logical_minimum) * resolution + h.physical_minimum; ++ switch (degrees) { ++ case 0: ++ hatmap_x[i] = 0; ++ hatmap_y[i] = -1; ++ matched++; ++ break; ++ case 45: ++ hatmap_x[i] = 1; ++ hatmap_y[i] = -1; ++ matched++; ++ break; ++ case 90: ++ hatmap_x[i] = 1; ++ hatmap_y[i] = 0; ++ matched++; ++ break; ++ case 135: ++ hatmap_x[i] = 1; ++ hatmap_y[i] = 1; ++ matched++; ++ break; ++ case 180: ++ hatmap_x[i] = 0; ++ hatmap_y[i] = 1; ++ matched++; ++ break; ++ case 225: ++ hatmap_x[i] = -1; ++ hatmap_y[i] = 1; ++ matched++; ++ break; ++ case 270: ++ hatmap_x[i] = -1; ++ hatmap_y[i] = 0; ++ matched++; ++ break; ++ case 315: ++ hatmap_x[i] = -1; ++ hatmap_y[i] = -1; ++ matched++; ++ break; ++ } ++ } ++ if (matched == range) { ++ if (h.logical_minimum == 0) { ++ hatmap_x[h.logical_maximum + 1] = 0; ++ hatmap_y[h.logical_maximum + 1] = 0; ++ } else { ++ hatmap_x[0] = 0; ++ hatmap_y[0] = 0; ++ } ++ } + } + break; + default: