Vegz78 / McAirpos

MakeCode Arcade games in RetroPie, Recalbox 7/8 and Batocera, running natively as ELF executables on Raspberry Pi OS/Linux ARM with 1-2 gamepads
https://Vegz78.github.io/McAirpos
MIT License
80 stars 10 forks source link

[Juyao 2] Homemade arcade gamepad problem(detected&working) #9

Closed claricerogue closed 3 years ago

claricerogue commented 3 years ago

I don't have so much experience with retropie and controller config so sorry if it's a basic config problem. I have two usb homemade arcade controllers. Both work with emulation station and arcade games but when i run a makecode game, unless it works during the game, I can't exit with the start-hotkey buttons, I have to use the keyboard ctrl/ and then both gamepads miss the configuration for all retropie, and I have to reset the machine. If I only reset emulastation, it shows the makecode's last game screen, as if it continue running but controllers or keyboard doesn't work any more. When I reset, pads get the correct config again. Do I have to config the controllers by command line? If so, the mcairpos controller config affects the retropi controller config?

Vegz78 commented 3 years ago

I don't have so much experience with retropie and controller config so sorry if it's a basic config problem.

No prob, controller support is not basic at all... ;-)

I have two usb homemade arcade controllers.

Which make and model of parts?

Both work with emulation station and arcade games but when i run a makecode game, unless it works during the game, I can't exit with the start-hotkey buttons, I have to use the keyboard ctrl/ and then both gamepads miss the configuration for all retropie, and I have to reset the machine.

McAirpos uses raw Linux input subsystem events with mapping to MakeCode inputs and sadly is not integrated with the setups in RetroPie/EmulationStation, all though that would have been a better solution(but grew a little weary when I got it to work).

Many controllers should work out the box with standard config as shown in the readme, but if not, may require a little tinkering.

Have/Could you try the XBox controller that you mentioned earlier over USB as a first test? Worked for me.

If I only reset emulastation, it shows the makecode's last game screen, as if it continue running but controllers or keyboard doesn't work any more.

It seems that the controllers are recognized, but inputs not mapped correctly. If you only connect one controller, the keyboard should stay mapped and you should be able to exit with ESC while you figure it out.

The whole McAirpos started as a launcher to exit and clear this screen/console freeze, game pad support was added later as a hack, leaving a little work to the user, as integration with RetroPie/Recalbox etc., or supporting every controller type is a much larger project.

But I would like to help as much as I can so we can build a knowledge base in the issues section and maybe users could share their working config files here for others with similar setups.

Do I have to config the controllers by command line? If so, the mcairpos controller config affects the retropi controller config? Probably, but McAirpos configs are completely independent from RetroPie which should not be affected.

It might be easier to exit RetroPie to the Linux console and launch games manually with launCharc game_file.elf while you figure this out.

These posts might help you and contain info I would need from you to be able to help with the configs:

https://github.com/Vegz78/McAirpos/issues/6#issue-787757359

https://github.com/Vegz78/McAirpos/issues/6#issuecomment-761887899

claricerogue commented 3 years ago

I've tested with xbox gamepad and work ok, even start+hotkey combo, so it's my gamepad config. I'm going to check the link and see what can i make. My controller is this one, unless it's a dual controller I have two working as mono controller because I've read that retropie doesn't support this kind of connection. https://es.dhgate.com/product/for-4-8-connector-juyao-2-players-pc-ps-3/387652783.html

Vegz78 commented 3 years ago

I've tested with xbox gamepad and work ok, even start+hotkey combo,

Great, that’s a start!

so it's my gamepad config. I'm going to check the link and see what can i make.

If it’s possible to reconfigure the gamepad’s wires/config to something that works with McAirpos already, that may be a way. Pretty heavy the first time to mess with uinput-mapper’s arcade.py and nice to avoid it if possible.

Another option, if your controller setup is fixed and they only have EV_KEY(on or off) buttons and stick inputs(not variable EV_ABS), is to use the launCharc nomap option and attemp to set up your controller as GPIO inputs OR EV_KEY scan code inputs directly in /sd/arcade.cfg, like in some of these official Makecode game hardware configs: https://github.com/microsoft/uf2-linux/tree/master/cfg

My controller is this one, unless it's a dual controller I have two working as mono controller because I've read that retropie doesn't support this kind of connection. https://es.dhgate.com/product/for-4-8-connector-juyao-2-players-pc-ps-3/387652783.html

Would need evtest and /home/pi/McAirpos/McAirpos/uinput-mapper/input-read -v -p /dev/input/eventX for your gamepads to make any sense of them, and don’t know about mono vs dual, unfortunately.

Good luck and hope to hear back from you with the solution and working configs/description for others to use!

claricerogue commented 3 years ago

16165410760556305309219919396759

claricerogue commented 3 years ago

I have this config. Is it supported by your mapping? Thanks

claricerogue commented 3 years ago

I have tries launCharch with nomap and gamepad doesn't work, without nomap works the joystick and A/B but can't exit. Start, select and hotkey doesn't work and ctrl+z hangs the system.

Vegz78 commented 3 years ago

Now we’re making progress!

I have this config. Is it supported by your mapping? Thanks

Not immediately supported(since it doesn’t work...), but recognized as a controller from the scan code “BTN_SOUTH”.

It can, however easily be modified to work, if you know which of those scan codes for each controllers are/you want to be: left, right, up, down, button A, button B, start button, select and home/menu.

Try with evtest and press all those and make notes.

This image is one of the two controllers on event5, right?

Then(if any EV_ABS inputs, which is probable) you could try to edit McAirpos/uinput-mapper/configs/arcade1.py and 2.py(1 and 2 gamepads).

Inputs to modify are on left side of :, like “ABS_X:”.

Or, if stuck, I could give it a try tomorrow based on all the needed scan codes for stick and buttons for both controllers. Too late here now.

Vegz78 commented 3 years ago

I have tries launCharch with nomap and gamepad doesn't work, without nomap works the joystick and A/B but can't exit. Start, select and hotkey doesn't work and ctrl+z hangs the system.

Ok, great! 66.6% there, only 33.3% to go, then.

Then run without nomap and you only need to find(evtest) the actual scan codes for the start, select and hotkey buttons on your controllers, and change only all occurrences of those three(BTN_START:, BTN_SELECT: and BTN_MODE:) accordingly in the same two arcade.py files.

Or, make sure your gamepads actually outputs scan code BTN_START when pressing start button etc. The scan codes are present in the image you uploaded here, so I don’t really understand at the moment why it doesn’t work right out of the box... ;-)

Vegz78 commented 3 years ago

Did you find the scan codes for your controllers for start, select and mode in evtest?

claricerogue commented 3 years ago

Sorry got the delay. With your indications I could find the correlation between pins of the controller, your codes and mine. Problem was that my buttons were connected to pins associated with TL, TR, TL2 instead with START, SELECT and PS/MODE. I've made the wire changes and now it works, even Start(Esc) to leave the program and returns to simulationstation. Thanks for your support. You have make an amazing work with the program.

El mié, 24 mar 2021 a las 8:53, Vegz78 @.***>) escribió:

Did you find the scan codes for your controllers for start, select and mode in evtest?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Vegz78/McAirpos/issues/9#issuecomment-805584712, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARN3SBTNY4SXAFYBIJPIXIDTFGK7BANCNFSM4ZV4NVDA .

Vegz78 commented 3 years ago

I am glad that it works for you now, and thanks for confirming and your compliment! If you could please award a new start for the McAirpos repository, I would appreciate it. Happy retro game making and playing! ;-)