9front - general discussion about 9front
 help / color / mirror / Atom feed
* nusb/joy vs. off brand joy
@ 2019-10-05  1:00 vp
  2019-10-05  7:46 ` [9front] " Rodrigo G. López
  0 siblings, 1 reply; 2+ messages in thread
From: vp @ 2019-10-05  1:00 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

I had no restraint and have helped myself to a White Shark®
"DoubleShock", "PC-compatible", "gaming only", ultra-cheap
game controller.

Nusb/joy complains about not finding a suitable endpoint
because it demands:
	ep->dir == Ein
while my controller happens to report a both-way endpoint.
Allowing the Eboth endpoint makes it work fine, but I don't
know if this could be troublesome for other controllers.

Patch is attached.

-- kvik

[-- Attachment #2: Type: text/plain, Size: 473 bytes --]

diff -r b73f589b3c7d sys/src/cmd/nusb/joy/joy.c
--- a/sys/src/cmd/nusb/joy/joy.c	Sat Sep 07 02:13:35 2019 +0200
+++ b/sys/src/cmd/nusb/joy/joy.c	Sat Oct 05 00:49:16 2019 +0000
@@ -431,7 +431,7 @@
 	for(i = 0; i < nelem(ud->ep); i++){
 		if((ep = ud->ep[i]) == nil)
 			continue;
-		if(ep->type == Eintr && ep->dir == Ein && ep->iface->csp == JoyCSP)
+		if(ep->type == Eintr && (ep->dir == Ein || ep->dir == Eboth) && ep->iface->csp == JoyCSP)
 			break;
 	}
 	if(ep == nil)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] nusb/joy vs. off brand joy
  2019-10-05  1:00 nusb/joy vs. off brand joy vp
@ 2019-10-05  7:46 ` Rodrigo G. López
  0 siblings, 0 replies; 2+ messages in thread
From: Rodrigo G. López @ 2019-10-05  7:46 UTC (permalink / raw)
  To: 9front

now you can play aap's GTA ports for 9 (after porting them of course.) :D


On October 5, 2019 1:00:53 AM UTC, vp@a-b.xyz wrote:
>I had no restraint and have helped myself to a White Shark®
>"DoubleShock", "PC-compatible", "gaming only", ultra-cheap
>game controller.
>
>Nusb/joy complains about not finding a suitable endpoint
>because it demands:
>	ep->dir == Ein
>while my controller happens to report a both-way endpoint.
>Allowing the Eboth endpoint makes it work fine, but I don't
>know if this could be troublesome for other controllers.
>
>Patch is attached.
>
>-- kvik

-rodri


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-05  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-05  1:00 nusb/joy vs. off brand joy vp
2019-10-05  7:46 ` [9front] " Rodrigo G. López

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).