libretro-mirrors / beetle-saturn-libretro

Standalone port of Mednafen Saturn to the libretro API.
GNU General Public License v2.0
62 stars 43 forks source link

Hook Up 3D Control Pad [$35] #12

Closed Awakened0 closed 7 years ago

Awakened0 commented 8 years ago

This feature from stand alone hasn't been hooked up in libretro yet. You can select the 3D Pad in input settings, but using the left stick seems to give start and face button inputs right now.

--- Did you help close this issue? Go claim the **[$35 bounty](https://www.bountysource.com/issues/37462706-hook-up-3d-control-pad?utm_campaign=plugin&utm_content=tracker%2F43093589&utm_medium=issues&utm_source=github)** on [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F43093589&utm_medium=issues&utm_source=github).
Zer0one commented 8 years ago

Confirm this happen to me too…

JacobAL commented 7 years ago

Yeah, the 3d pad is completely messed up.

rtissera commented 7 years ago

Proposed implementation here : https://github.com/libretro/beetle-saturn-libretro/pull/45

inactive123 commented 7 years ago

merged the PR. I will let you guys know once the core has been recompiled.

The bounty pledgers will have to test it then.

inactive123 commented 7 years ago

To @Awakened0 and all other bounty pledgers - the cores have been updated on the buildbot. Please test it out and if you feel satisfied with the implementation, we can proceed with the bounty checkout.

Awakened0 commented 7 years ago

The win64 builds don't seem to be updated; they still have the timestamp from yesterday on the buildbot webpage. I tried testing it anyway and got no input when selecting the 3D pad. I also tried building myself with mingw, but got an error: https://hastebin.com/urihugatey.tex

rtissera commented 7 years ago

https://github.com/libretro/beetle-saturn-libretro/pull/46 My fault.

Awakened0 commented 7 years ago

I tested 3D Pad support in Burning Rangers, Christmas NiGHTS, NiGHTS, Panzer Dragoon, Panzer Dragoon II, Panzer Dragoon Saga and Sega Rally Netlink Edition. It seems just as good as stand alone! Sega Rally is really sensitive to stick drift though; must have a small dead zone. I don't see any dead zone adjustment in stand alone, but it'd be nice to have the core option here.

@twinaphex what do you think about an additional mapping of right trigger to up on the right stick and left trigger to down? The right stick isn't used so I thought that would be a decent work around to get analog acceleration and break in Sega Rally. I think some of the Gran Turismo games did that.

tapperp commented 7 years ago

Hello rtissera,

I just tested this build using an Xbox One Elite pad with Daytona Circuit Edition, and there is drift to the right on the analog. I've seen this sort of thing before when apps coded for Xbox 360 pads is also used with Xbox One pads, and the XBone analog will either drift of be too sensitive (no dead zone). The One pads seem to have greater granularity and/or range to their analog, so basically I agree with Awakened0's comment.

If you can implement a dead zone core option, that would probably solve this.

But yeah, great job hooking up the 3D pad! It's very close now, just needs a little tweaking!

rtissera commented 7 years ago

@tapperp @Awakened0 thanks for your valuable feedback !

I am actually passing "raw" controller data to internal Mednafen core functions so this should be 1:1 behaviour as standalone Mednafen.

OK, I can add a dead zone core option. Do you know if any other core has a dead zone core option ? The implementation itself is not complicated but I would like to see how it is presented to end-users in the options menu.

tapperp commented 7 years ago

@rtissera,

That is a good question. Because I have not noticed drift in any other core using this Elite pad.

I'm gonna test a couple more games and will report back.

tapperp commented 7 years ago

UPDATE: Yeah, my analog is very sensitive. Example, in Dark Savior, just barely touching the analog will begin moving the camera, and in Sega Rally there is a bit of drift to the right but maybe not as bad as Daytona Circuit Edition.

I tried changing the main Retroarch analog dead zone setting, but that only affects the analog in the menus. So, I think the Saturn Mednafen core maybe needs its own dead zone option.

Thanks for working on this much needed part of the Saturn core.

UPDATE 2: Yes! There is an analog dead zone option in the Parallel64 core. Also, the PSX Mednafen core has an option called "analog self calibration" which I have checked on, but not sure how it works or if it's related to dead zones etc.

Awakened0 commented 7 years ago

Yeah, I was going to mention that the N64 cores are the only ones I've noticed with dead zone adjustment. I'm not sure how the PSX core's calibration option affects dead zones either.

Funny, I'm also using an Elite controller and have it pulling to the right slightly in Sega Rally :P. I'm glad it doesn't affect the other games I tried. Racing games tend to be more sensitive; I've noticed some pull to the right in Enduro Racer in the latest MAME core too. Happens in Trackmania games as well, which thankfully have a deadzone option.

rtissera commented 7 years ago

OK let’s add a dead zone option similar to the Parallel 64 implementation. I will look into this ASAP.

Le 2 août 2017 à 21:32, Awakened0 notifications@github.com a écrit :

Yeah, I was going to mention that the N64 cores are the only ones I've noticed with dead zone adjustment. I'm not sure how the PSX core's calibration option affects dead zones either.

Funny, I'm also using an Elite controller and have it pulling to the right slightly in Sega Rally :P. I'm glad it doesn't affect the other games I tried. Racing games tend to be more sensitive; I've noticed some pull to the right in Enduro Racer in the latest MAME core too. Happens in Trackmania games as well, which thankfully have a deadzone option.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/beetle-saturn-libretro/issues/12#issuecomment-319774710, or mute the thread https://github.com/notifications/unsubscribe-auth/AC3LBeutnb4h89pGni3AjK1_gUW1IGu7ks5sUM7hgaJpZM4JyCc7.

tapperp commented 7 years ago

Thanks rtissera.

One other thing, if possible -- the Saturn 3D Pad had a switch on the front marked + and O to switch the analog mode on and off. I was thinking that switch could be mapped to the Select/View/Back button on a typical controller as a toggle.

Here's a good photo: https://upload.wikimedia.org/wikipedia/commons/b/b7/Sega-Saturn-JP-3D-Pad.jpg

That would be great since we could leave the core set to 3D Pad, and when a game doesn't work with it, we could just toggle analog off like a real Saturn 3D pad.

Not a necessity, but would be cool to have!

rtissera commented 7 years ago

@tapperp OK.

Le 2 août 2017 à 23:58, tapperp notifications@github.com a écrit :

Thanks rtissera.

One other thing, if possible -- the Saturn 3D Pad had a switch on the front marked + and O to switch the analog mode on and off. I was thinking that switch could be mapped to the Select/View/Back button on a typical controller as a toggle.

That would be great since we could leave the core set to 3D Pad, and when a game doesn't work with it, we could just toggle analog off like a real Saturn 3D pad.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/beetle-saturn-libretro/issues/12#issuecomment-319810862, or mute the thread https://github.com/notifications/unsubscribe-auth/AC3LBaEsgFxc3sJRBVmp5-wcV7TQBlJjks5sUPEQgaJpZM4JyCc7.

rtissera commented 7 years ago

PR here https://github.com/libretro/beetle-saturn-libretro/pull/47

Awakened0 commented 7 years ago

I tested it and now the analog axis' seem to randomly invert when trying to move one of the kids around in NiGHTS :O

rtissera commented 7 years ago

Can you tried disabling the deadzone (set to 0 in core settings) in order to narrow down the issue ? It might be the cartesian / polar coordinates conversion code I borrowed blindly pasted from ParaLLEl-N64 having some issues to limits.

Le 5 août 2017 à 20:39, Awakened0 notifications@github.com a écrit :

I tested it and now the analog axis' seem to randomly invert when trying to move one of the kids around in NiGHTS :O

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/beetle-saturn-libretro/issues/12#issuecomment-320462783, or mute the thread https://github.com/notifications/unsubscribe-auth/AC3LBbByDOYkPTKQcQMFH0_x87FMGLcXks5sVLblgaJpZM4JyCc7.

Awakened0 commented 7 years ago

Yep, setting it to 0 fixes it.

rtissera commented 7 years ago

Ok thanks it does help for bug fixing.

Le 5 août 2017 à 20:43, Awakened0 notifications@github.com a écrit :

Yep, setting it to 0 fixes it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/beetle-saturn-libretro/issues/12#issuecomment-320462960, or mute the thread https://github.com/notifications/unsubscribe-auth/AC3LBZ1iUSvfhekAqhw4Z8lB5_g4WTPfks5sVLe2gaJpZM4JyCc7.

tapperp commented 7 years ago

Just tried a race in Daytona Circuit (Japan) and it was great! No analog drifting. Thank you!

Would test more, but it's my bday and going out with my wife now. :-) But so happy to see the Saturn core advancing.

rtissera commented 7 years ago

@Awakened0 PR here https://github.com/libretro/beetle-saturn-libretro/pull/48/commits/06e3bf830b91ed9bb2a9cb11a1a52c721a885b5e for your deadzone issues, please test once merged and built.

Awakened0 commented 7 years ago

Tested out the deadzone set at 15 and 30 in NiGHTS and it works perfectly now! 15 is enough to fix my drifting issues in Sega Rally; I can use 0 in everything else :D

Oh, and the mode switch works fine, at least in NiGHTS.

rtissera commented 7 years ago

Anyone here can test / confirm it's working properly ? Maybe we can close this one then.

inactive123 commented 7 years ago

I'll close it for you. If anybody else still has an issue, they can open another issue.

rtissera commented 7 years ago

@prataczak mode switch has been implemented on RETRO_PAD_SELECT button.

prataczak commented 7 years ago

I see that now. That's unfortunate for me - I actually use that button as my RetroArch hotkey. :)

Any chance of making that mappable to another key? I will approve the bounty as you've earned it regardless.

However is one more issue, and I'm not sure if this has anything to do with anything you've done or not, but I suspect it might.

With the latest core, the RetroArch menu no longer loads for me - it instantly crashes when I try to load it. I've tried to load it with the hotkey, keyboard shortcuts, and button combo, and it crashes all 3 ways.

rtissera commented 7 years ago

@prataczak Okay I will have a look to be able to remap this. No clue for the RetroArch menu issue still. What platform are you testing on ?

prataczak commented 7 years ago

Windows 10/RetroArch 1.5.0

rtissera commented 7 years ago

@prataczak Okay thanks I will try to reproduce then. 64 bit or 32 bit ?

prataczak commented 7 years ago

64 bit. Game I tested with was Nights Into Dreams if that matters. :)

prataczak commented 7 years ago

Weird... I just tested it again, and now it's working fine. I was able to reproduce it 6 times in a row, only thing I've done in the meantime is do some work with PC Engine CD.

But at any rate it must have been something on my end. Sorry to waste your time on that one. :)

I appreciate you taking the time to make the mode key remappable. The thing is if I don't ask you to do that now it would probably never get done, and it really is nice to be able to fully customize things. I will probably map it to R3 or something out of the way and hard to press accidentally.

Let me figure out how to approve the bounty and I'll take care of that right now.

Awakened0 commented 7 years ago

I was gonna say, couldn't you just remap it from Quick Menu, Controls and save a core remap, but Select doesn't show there. @rtissera you should be able to label it as "Analog Mode Switch" and have it in the remap menu. There are several cores that have utility buttons that are remappable like that. Nestopia UE is one I can think of off hand, with its "(FDS) Disk Side Change" button: https://github.com/libretro/nestopia/blob/master/libretro/libretro.cpp#L878

Edit: Yeah, I think the only reason it's not showing up in the remap menu is because it doesn't have an input descriptor like the other buttons do.

prataczak commented 7 years ago

@Awakened0 yes that would be perfect if it were to be implemented exactly as you described.

rtissera commented 7 years ago

@Zer0one Answering here to your bounty reject, there is currently no way of handling analog triggers in the libretro API.

inactive123 commented 7 years ago

Hi there, I will come up with a way to allow for analog buttons/triggers in the API and frontend at some point. This falls outside the scope of this issue/bounty. Please consider changing your reject into an accept, since Romain did put significant work into this one and its not his fault these parts are not implemented yet in our backend technology (API + frontend). I am sure once this is implemented on frontend/API side, this would be easy to implement.

rtissera commented 7 years ago

Remapping mode switch has been implemented in a recent merged PR, @prataczak can you test ?

prataczak commented 7 years ago

After upgrading the core again, my issue of not being able to load the menu while using that core is back. I don't know why this is happening, trying to get it sorted out. It happened the same way the last time.

prataczak commented 7 years ago

I deleted my 'core overrides' file for that system, and that solved it.

Ok so I tested it and it works great! I'm very happy with it. :)

Thank you so much for taking the extra time to do this for the community.

rtissera commented 7 years ago

@prataczak OK great. Don't like half-done job neither ;)