-
-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: INI options for controllers to combine and define PID's/VID's for players #785
Comments
there is already option in INI: |
Thank you. While that is helpful for single USB controllers and multiple players, this request is to allow multiple controllers to be assigned to a single player. A control panel may consist of different third party USB controllers that combine together to make all the controls for the arcade game. If the above is not feasible for multiple players each with multiple controllers, then at least an option to combine all detected controllers to be available for player 1 would be helpful. Thanks again. |
Theoretically, assigning several controllers to a single player is possible. I will check it. |
In latest commit i've added multiple device mapping. |
Thank you very much! This is really great and appreciated. I am happy to help test, but I am slightly embarrassed and sorry to say that I don't know what I need to do to install the latest code onto my MiSTer from the commit. I am very familiar with Linux, but not with getting stuff out of the latest git commits. I am not sure what files I need and where to put them. I see the new code is out there. Can I just run update or update_all, or is it not available as a main release to the public yet? |
Do you know how to get nightly/unstable builds? |
this is zipped Main with latest changes: if you don't know how to get unstable builds, then you can unzip it and replace MiSTer binary manually. |
Thanks! I don't know how to get the builds, but I will try the zip file and let you know how it goes. Also, when defining the controls, the first thing it asks you to do is press right. This wakes it up so it knows what device you are programming and at the same time programs the right direction. Not every controller has a "Right" to push. Can you fix it so that the User button can bypass all the questions until you get to the first one that applies to the controller. For example, I have a set of USB analog pedals with gas and brake. I can't program these because I have to wake them up with the Right direction. |
This problem is hard to solve, actually. Controllers are supposed to be able to control OSD, so directions are essential parts. Waiting for ANY event from controller is not reliable because some analog controllers may have noise and periodically spit the events preventing to map other controllers. Direction-less controllers are usually spinners/paddles which have no traditional mapping, so mapping dialog is useless for them. If spinner uses mouse events, then it should be defined through special options in ini. As a workaround, you may edit |
Thanks! Upon my first testing, this is working great! I tested Super Smash TV on the SNES with two controllers and was able to use one for firing in different directions and the other to move around. This is really great! One problem I did notice though is that I am getting an INI file error when starting the MiSTer with the line: If I comment out the line, I don't get the error. I haven't tried the gamecontrollerdb stuff yet, but that sounds encouraging. I will look into it. I did try Discs of Tron with a push-pull spinner that uses mouse buttons and it wouldn't let me change the function of the mouse buttons to go up and down in the game (it instead throws the disc). Are you saying there is a way in the INI file to change these functions? I tried using the joystick button mapping but it just ignores the spinner's mouse clicks, same as you have stated above. I have since worked with the manufacturer and they came out with a new version that lets you wire up to the up/down so I can tie it together with the Joystick's Arduino. It would be cool if it would have just worked though and maybe there is a way with the INI file. In any case, maybe the DOT core can be updated to allow changes to the spinner's mouse button functions so up/down will work with them. Scroll Up/Down are also functions of the spinner that could be mapped in the game. |
strange.. i can't reproduce it. May be you've typed letter O instead of number 0?
Nope. Spinner is supposed to have only single button. Spinner is considered as an overlay device. So using together with gamepad/joystick you can use spinner with its button as a main action (like fire or jump) and additional buttons from joystick. |
Strange. I uncommented the line and I don't get the error anymore. Maybe it only shows up with a new unmapped in the main menu device or something if it is defined in the INI file already. I am not sure. I wouldn't worry about it I guess. My spinner when I hook it up to my PC acts like a mouse going left and right, and it will also left click, right click, scroll up, and scroll down. In order to get it to work with DOT, I had to define the Spinner's vid and pid, and functionally, it provides a single button as you mentioned. Both left click and right click act like the same single button. I started looking further into the gamecontrollerdb.txt. I didn't find the _mister version. This looks promising, but I wonder about the core mapping. For example, if I wanted to use my USB pedals with Outrun, is there a default mapping for the gas and brake to a particular control in the gamecontrollerdb.txt that I can define? Otherwise, I will run into the same problem when inside the core, I tell it to map the joystick buttons and it wants me to press right and won't let me bypass it. Also, I am trying to figure out how to get the device ID for the gamecontrollerdb.txt. I am doing some searching in the meantime. Thanks again for all of your help. Edit: I did a killall MiSTer; /media/fat/MiSTer and plugged in the USB pedals and this is scrolling on the screen... opened 0( 0): /dev/input/event1 (061c:0301:7a9b6ea3) 0 "usb-ffb40000.usb-1.2/input0" "ACT LABS ACT LABS Performance Pedal System" 061c:0301:00 P0 Input event: type=EV_ABS, Axis=3 [0...255], Offset=246 So if the core is expecting the gas and brake on a certain set of controls, I could use the gamecontrollerdb.txt to map the pid/vid/hash and axis to those controls. Gas is Axis 3 an Brake is Axis 4. They both have a high number close to 255 before you press them down and the number goes down to close to zero. |
I think it's better to discuss such thing on MiSTer forum. |
Thanks. I did some more experimenting. I deleted the Outrun.cfg files in the config folder and used my Xbox 360 wired controller clone that already exists in the gamecontrollerdb.txt file with Outrun and didn't configure the joystick button mappings. With the controller_info=6 defined in the MiSTer.ini, it told me what button was assigned to what for that controller. It said that buttons were used for gas and brake. I also noticed that the analog stick worked with up/down for gas/brake, but it still seemed to be digital (full on/full off). I then tried joystick mapping the gas/brake functions to the triggers and it was still full/on full/off, so I guess for Outrun the gas and brake are digital. This experiment was enough for the moment to tell me how to proceed. Delete the config files for the game and see what the default expected behavior is, then assign any new controller in the gamecontrollerdb.txt file and map the controls to the ones the core is expecting. The last thing I need to figure out is how to get the long string that the gamecontrollerdb.txt is expecting like: 030000005e0400008e02000014010000 Thanks again for your help! I really appreciate the new feature, and will put it to good use! |
it's here: Main_MiSTer/gamecontroller_db.cpp Line 529 in d5f41db
bustype is always you can use |
Great! Thanks a lot for your help! |
This isn't exactly related to this feature, but I was wondering, do the left and right analog triggers work as analog in the MiSTer? I can see that Linux recognizes them as analog, and I can map them to up and down analog thumbstick functions, but when in the main menu mapping the joystick, the analog triggers are not asked about. I am trying to use them with the arcade core Spy Hunter as analog gas/brake and they don't work unless I change the core menu to set them as digital. I have made a custom driving control panel that uses an Xbox 360 controller as the brains and I mapped the gas and brake to the left and right analog triggers. So far the analog triggers only work as digital in the cores I have tried. There are many many cases where analog triggers would be helpful within the cores, especially for throttle and brake. Am I doing something wrong, or are these not supported, and if not, can you please add them? Spy Hunter is a good example test case. I would be happy to create a new github issue for this if you would like. Thanks! |
MiSTer doesn't support analog triggers. They are converted to digital buttons if gamepad generates standard events. |
Thank you for letting me know the current status. Is there any chance that you can add this, please? It would be very helpful and add a lot of flexibility to configuring the control options for various cores and games within cores. I assume most people use controllers that have the analog triggers so it could benefit a lot of people as well, not just arcade cabinet users. Thanks for your consideration. |
With an arcade cabinet, there are many situations where different USB controllers are needed for a single player, like a USB stick shift and USB pedals and a USB steering wheel, and there are times when you want to combine controls and other times when you want to keep them separate. Each core can be configured independently in the INI file. When creating controls with Arduinos and other devices, you can specify new PID's and VID's to distinguish them from other Arduino controllers.
Please add an INI option to specify the multiple specific PID's and VID's you want to use for Player 1, Player 2, Player 3 and Player 4. It could look like this:
[corename]
P1PIDVIDS=1240x2000,1240x2001,1240x2002
P2PIDVIDS=1240x2003,1240x2004
P3PIDVIDS=1240x2005,1240x2006
P4PIDVIDS=4320x1335
The above settings would supersede any other settings so previous functionality could still work with joystick mapping when these are not defined.
This would allow those with arcade cabinets to use multiple custom controls for a single player with having multiple PIDs and VIDs used for a single player, but still have the option to have more than one player with its own controls.
Also, if the same PID/VID is plugged in more than once, they could be assigned in order of the way they are plugged in like they are now for different players 1-4. These could still be specified in the P#PIDVIDS lines in the INI file and used more than once.
Thanks!
The text was updated successfully, but these errors were encountered: