Provenance-Emu / Provenance

iOS & tvOS multi-emulator frontend, supporting various Atari, Bandai, NEC, Nintendo, Sega, SNK and Sony console systems… Get Started: https://wiki.provenance-emu.com |
https://provenance-emu.com
Other
5.97k stars 689 forks source link

Analog Joystick(s) input is FUBAR (PSX) #826

Closed gh0sti closed 6 years ago

gh0sti commented 6 years ago

[Edited by admin] Joysticks input is locked to forward (L) and left-ish position (R) — dead zone is off?

Expected

Joysticks are idle, in dead zone. Characters or Camera do not run/move.

Actual

Right Stick is locked to left? Left Stick might be locked forward…hard to say. Need to test more games… usually move was L stick, and look was R stick, and both are happening: run forward and left.

Steps to Reproduce**

  1. Launch any Spyro game, or Spider-Man on PSX
  2. Get to gameplay and watch running in circles.

Version

iPhone X, iOS 11.3, using latest commit 7fa2ce07 no MFi controllers or anything else connected.

#

Maybe the dead zones got fucked up in mednafen updates?

#

Video Reference: https://cdn.discordapp.com/attachments/421976543506464768/434799003876589568/video.mov

Zer0one commented 6 years ago

Similar behavior happen on CTR (USA)… Only that the controller is stuck on Top-Left without touching anything… After some investigation I found out that things broke on commit 9750f17 (work correctly on d757e75 and previous).

JoeMatt commented 6 years ago

That's odd since nothing with psx nor controllers was changed in that commit that i saw.

I'll bump back to 1.5 to double check.

jasarien commented 6 years ago

Mednafen was updated, right? Could they have changed something internally with regards to analog controls?

sevdestruct commented 6 years ago

Updating/Editing op, more info from #bugs channel and my own test run to confirm it. I suspect something from mednafen updates, apart from @Zer0one's report another user reporting friom #bugs that wasn't the case in as far back as a238067a, which is likely pre-mednafen-update…

sevdestruct commented 6 years ago

Bumping this to blocker status. It plagues a shit ton of games, making them unplayable.

JoeMatt commented 6 years ago

It's not that code mentioned above by the way, comment it out and bug still exists. I think it's the input buffer in general has the wrong values. Mednafen seems to have changed how it deals with the input buffer and isn't doc'd. I'm digging into it

ssh88 commented 6 years ago

Quick update in case it helps.

Spent the evening digging around MednafenGameCore.mm and think it def is the Mednafen update you guys mentioned.

After fiddling around with the values in didMovePSXJoystickDirection:withValue:forPlayer and removing the else statement at the end off pollControllers to no luck, I eventually disabled all controller inputs by removing the call to pollControllers in executeFrameSkippingFrame:.

Yet im still getting the issue of the game thinking the analogue is being locked to one side (tested using Spiderman and kept tapping the start button in provenance menu to get to the gameplay)

JoeMatt commented 6 years ago

Yeah I knew that a while ago, w which is what my comment above was about. That's the first test I did, remove all code writing into the input buffer and the bug still exists. It's something to do with either the buffer size, how it's initialized or some setting in mednafen that needs to be changed (try disabling players 2,3 & 4 first for a start)

JoeMatt commented 6 years ago

This commit may or may not have fixed it,

https://github.com/Provenance-Emu/Provenance/commit/aad8c22e0094e9b2aaa60963378c77471f30ce8e

Try toggling the controller to digital mode, or whatever the opposite is with the button sequence, well there is no start and select on mfi, so choose some other combo and test it

DarkRedFish commented 6 years ago

Tested it, in analog the issue is not reproducible and it works, but joysticks are not mapped so not usable. Back to digital mode the issue is automatically present, doesn't matter how many times you switch between the two modes.

sevdestruct commented 6 years ago

That is confusing. Not sure why @DarkRedFish is saying the issue is not reproducible, going on to contradict that in the second point as it literally specifies how to reproduce the issue…

So, @JoeMatt, confirming the issue still present, though it can be .. avoided , however not ideal. Not sure which mode is default (based on the above), I was assuming digital was not, and analog was the default since after the first toggle it enables the d-pad and disables the joysticks (unless i am forgetting how that button worked back in PSX days):

Update: the default actually depends on the game… Spider-Man defaults Analog on, Chrono Cross defaults it off at launch, for instance.

Switching to d-pad allows play, disabling analog input—switching back the issue recurs. (and as said above, no amount of switching rectifies that... of course)

JoeMatt commented 6 years ago

Yeah so if the joy sticks don't work in digital mode, that's expected, and it fixes the left going in circles, sounds like this is fixed as long as the d-pad is working, is it? If so, just need to change to a more sensible button combo

jasarien commented 6 years ago

@JoeMatt It sounds like it works in digital mode, sure, but as soon as analogue mode is enabled the problem is apparent again. Analogue mode should work for MFi controllers, even if we dont have analogue stick controls in the on-screen UI.

DarkRedFish commented 6 years ago

Sorry I just inverted digital and analog modes... But yes to sum up: Digital = no joysticks mapped so no problem Analog = joysticks and the issue is there (and like @jasarien said it should work for mfi controller users, to be able to use joysticks)

sevdestruct commented 6 years ago

Doesn't though. if in analog mode at all the issue is there. MFi or not.

jasarien commented 6 years ago

I didn’t mean that it should be working right now. I meant it should ideally work with MFi, as in, we need to fix this. Joe was suggesting that just turning off analogue fixes this issue, when it doesn’t. The issue is that analogues should work when the pad is toggled to analogue mode, and currently they do not.

sevdestruct commented 6 years ago

..I thought you might've meant that. Agreed.

gh0sti commented 6 years ago

latest commit does not fix this issue I don't have a controller to pair up just using the digital touch.

JoeMatt commented 6 years ago

Yeah but if the game is meant for a specific mode, I'm not sure how to fix it when it's in the other. Is crash meant to be played in digital mode only? No idea how to fix this since we never send a joystick input buffer value, unless it needs to be initialized to some value first.

sevdestruct commented 6 years ago

This worked before mednafen updates…I remember using sticks on Nimbus to control character in Chrono Cross, and I remember it wasn't mapping to digital input specifically because I slowly rotated his facing direction with left stick, I swear… (unless i'm batshit)

Anyway…

sevdestruct commented 6 years ago

To help with testing this for later, libretro has an ongoing list of the games that supported Analog and/or Rumble: https://github.com/libretro/libretro-database/issues/64

CJon428 commented 6 years ago

Did you guys find a temporary fix for this?

In Legend of Dragoon I noticed my character runs up and to the left without any input, making the game unplayable.

I tried the L1 + L2 + R1 + R2 + O but I don't believe it worked. Either that or my fingers are too big and I didn't actually press them all together.

Cheers! And keep up the awesome work.

Edit: I should add that in not using any external controller. Just the on screen buttons.

sevdestruct commented 6 years ago

@CJon428: Please read my last comment fully.

CJon428 commented 6 years ago

@sevdestruct forgive me. Which comment specifically? I read the one where you said you temporarily fixed it and remapped the button combination followed by the comment with the list of games that support analog / rumble.

Perhaps I'm missing something? Sorry for the trouble and I appreciate you getting back so quickly.

sevdestruct commented 6 years ago

The part that states: Temporarily fixed it. So answer is yes. Analog is disabled in latest build.

CJon428 commented 6 years ago

I thought I had the latest build. Perhaps not. Thank you again.

sevdestruct commented 6 years ago

fixed by @dybuk