Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
13 user(s) are online (9 user(s) are browsing Forum)

Members: 0
Guests: 13

more...


Browsing this Thread:   1 Anonymous Users




« 1 2 (3) 4 5 6 ... 10 »


Re: USB joystick and posseidon
#79
Home away from home
Home away from home


See User information
Dizzy: Hehe :) Great work. What are you drinking? Finlandia :D

Posted on: 2018/9/29 20:33
www.aspireos.com
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#78
Home away from home
Home away from home


See User information
And here's ofcourse a video about it...

Video

EDIT:

Think it's better to stop committing any more source code as I'm drunk as a monkey... and it's not my personal repository, as I've been told...

IGNITE

Posted on: 2018/9/29 16:38
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#77
Home away from home
Home away from home


See User information
With that bitmask we can finally start creating a generic XInput driver.

Didn't know before how many buttons each controller has (or analog axis)

We can get the bitmask for the wireless F710 controller, but not for the wired F310. I suspect that we need to give the controller some settling time and then ask it. Or repeat the request until it get's it.

I also believe that the line will tell if it's a wired or wireless, we will have to see once I get it going...

EDIT:

Here's what I'm so excited about:
EP0: 00 14 ff f7 ff ff c0 ff c0 ff c0 ff c0 ff 00 00 00 00 01 00

Here's the bitmask for the wired one!
EP0: 00 14 ff f7 ff ff c0 ff c0 ff c0 ff c0 ff 00 00 00 00 00 00

IT DOESN'T HAVE THAT ONE SINGLE BIT SET!!!!!!!!!!!! 'cause it's WIRED

EDIT:

For the latest commit I can say that the GUI indeed goes to sleep when the wireless controller goes to sleep...

Posted on: 2018/9/29 14:52

Edited by DizzyOfCRN on 2018/9/29 15:15:36
Edited by DizzyOfCRN on 2018/9/29 16:24:59
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#76
Home away from home
Home away from home


See User information
For the lowlevel problem I'll see if there's anything that comes up when I get to that point that I'll try to output data to something.

But in the meanwhile, I need to distinguish between wireless and wired controller. I think I know where it is informed (couple of suspects at the moment), but I need some information from controllers other than Logitech F710 or Logitech F310.

My first suspect is that it is in the XInput descriptor that Linux doesn't parse on lsusb command but shows as numbers. If anyone has access to Linux setup and some XBox wired/wireless controllers I'd be interested on the lsusb output.

EDIT:

Found one place on net, let's see if it has what I need...
https://github.com/linuxhw/LsUSB/search?p=2&q=xinput&unscoped_q=xinput

EDIT:

Nope! It wasn't there... (EDIT: You are really messed in the head right now, you know F710 and F310 has the same XInput descriptor) might be on that other location...

EDIT:

Found out that we can get a bitmask for all the inputs on a XInput gamepad, haven't seen that mentioned anywhere. :)

Posted on: 2018/9/29 13:02

Edited by DizzyOfCRN on 2018/9/29 14:36:25
Edited by DizzyOfCRN on 2018/9/29 19:28:26
Edited by DizzyOfCRN on 2018/9/29 19:31:28
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#75
Home away from home
Home away from home


See User information
Dizzy: What you wrote about 2 controllers is probably right. It is something wrong there. I can not get 2 player or 2 joysticks to work on anything. I know I configure everything correct with unit 1 and 0 in Trident, but only unit 1 seams to work correct.

Posted on: 2018/9/28 21:05
www.aspireos.com
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#74
Home away from home
Home away from home


See User information
Looks cool!

Posted on: 2018/9/28 15:08
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#73
Home away from home
Home away from home


See User information
I've enabled some rumble effects on the code. The intensity should vary according to the left thumb stick.

arosx.class AbiV1.i386

Works for Logitech F710 at least, not sure if the class even shows any output on other XInput gamepads...

A Video...

Posted on: 2018/9/28 14:30
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#72
Home away from home
Home away from home


See User information
Got back from work and the Poseidon is much more clever than what I was afraid.

It tries to patch the lowlevel.library for every device(interface) but does so only once and stores it at the class base. It also tries to patch it with the same install patch code function when DOS is available (might mean that AROS has opened at least the boot-up shell).

The patched function first reads value from the original lowlevel function and overwrites, merges or disables it with ALL interfaces it has in turn.

I might be a bit tired but something does not look right...

result = AROS_CALL1(ULONG, nh->nh_LLOldReadJoyPort, AROS_LCA(ULONG, port, D0), struct Library *, nh->nh_LowLevelBase);

     
KPRINTF(40, ("Before %08lxn", result));
     if(
port < 4)
     {
         
Forbid();
         
nch = (struct NepClassHid *) nh->nh_Interfaces.lh_Head;
         while(
nch->nch_Node.ln_Succ)
         {             
mode = nch->nch_CDC->cdc_LLPortMode[port];
             if(
nh->nh_LLAnalogueOverride[port] && nch->nch_LLAnalogue[port])
             {                 
mode = 4;
             }              switch(
mode)
             { 
//                case 0: /* don't touch */
 //                    break;
                  
case 1: /* overwrite with USB */
                     
result = nch->nch_LLPortState[port] | nch->nch_LLHatswitch[port] | JP_TYPE_GAMECTLR;
                     break;
                  case 
2: /* merge with USB */
                     
if(((result & JP_TYPE_MASK) == JP_TYPE_GAMECTLR) ||
                        ((
result & JP_TYPE_MASK) == JP_TYPE_JOYSTK) ||
                        ((
result & JP_TYPE_MASK) == JP_TYPE_UNKNOWN) ||
                        (!
result))
                     {
                         
result = (result & (JP_BUTTON_MASK|JP_DIRECTION_MASK)) | nch->nch_LLPortState[port] | nch->nch_LLHatswitch[port] | JP_TYPE_GAMECTLR;
                     }
                     break;
                  case 
3: /* disable */
                     
result = JP_TYPE_NOTAVAIL;
                     break;
                  case 
4: /* overwrite with analogue USB */
                     
if(nch->nch_LLAnalogue[port])
                     {
                         
result = (nch->nch_LLPortState[port] & ~JP_DIRECTION_MASK) | (nch->nch_LLAnalogue[port] & JP_XYAXIS_MASK) | nch->nch_LLHatswitch[port] | JP_TYPE_ANALOGUE;                     }
                     break;
             }
             
nch = (struct NepClassHid *) nch->nch_Node.ln_Succ;
         }
         
Permit();
     }



Pseudo code:

0: get result from original function
1: get interface mode for writing the data and the data
2: apply the data over the result in which way the mode describes it
3: loop to 1 while there are interfaces still left.

If one sets two different joysticks to the same ll-port and one of them is overwrite then the value depends on who got there first... also there might be a third stick, not intended to be used but the user forgot to go the settings and disable it.

On Trident it seems possible to map interfaces to the same ll-port. Merge would be safe but overwrite is touch and go.

Posted on: 2018/9/28 11:34
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#71
Home away from home
Home away from home


See User information
The merger idea sounds good to me. The only extra info needed is which class occupied which lowlevel ports.

Posted on: 2018/9/28 10:23
My AROS&MorphOS ports
Arguments that explain everything... explain nothing.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: USB joystick and posseidon
#70
Home away from home
Home away from home


See User information
There are few options that come to mind.

Firstly don't patch the lowlevel.library directly in hid.class, but send the information to a "merger" that has patched the lowlevel.library. arosx.class could also safely send it's outputs there then

Second aproach is bit hacky... make some lowlevel compatible arosx_ll.library and alter lowlevel.library's name in the game file(s) in hex editor to that :)

Posted on: 2018/9/28 9:14
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




« 1 2 (3) 4 5 6 ... 10 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project