Input issues with mednafen_psx

Ok, seems you are quite confused here. Forgive me, not trying to call you a noob or anything, I’m just gonna be very thorough for the sake of the explanation.

Retroarch works like a console (actually a virtual console) where you run games (in this case cores). As any other console it has it’s own gamepad (virtual), it’s called the RetroPad. If it was real it would look like this:

BTW, there is no actual RGUI button in the RetroPad. Now, this gamepad as I mentioned is virtual, actually it’s an abstraction, and it was designed to cover most use cases of retrogaming. Since it’s virtual you have to map a real controller to that pad, and that’s what you are doing when configuring via RGUI or via the cfg file.

Every button / axis of that virtual gamepad can be mapped to a key, a button or an axis of a real input controller. Then there is the core, cores are “hardwired” to the retropad. In SNES’s case, the directional buttons are wired to RetroPad’s hat, YXABLR are wired to YXABLR and the same for SELECT/START. Analogs aren’t wired at all.

But what if you want to move the character with the Left Stick? Well that’s what analog_dpad_emulation is for. It emulates a dpad using an stick without having to remap your buttons. It doesn’t disconnect the hat, so both should work when it’s enabled. Without analog_dpad_emulation you would have to remap RetroPad’s hat to your controllers Left-stick axes to achieve the same.

With PSX things are a lot more complicated.

PSX had three notable gamepads, the basic PS1 pad (no analogs), the Dual Shock and it’s predecesor, the Dual Analog. Some games support them all, some games only support some. For instance MMX4 won’t work with a Dual Shock unless you disable the analogs (on the real console). The Dual Shock and Dual Analog had a button to toggle analogs on/off. While off these pads would behave like a PS1 Pad, when on the pad would tell the console HEY I’M A DUALSHOCK and initiated a different communication protocol.

So, in the mednafen core you have the possibility of using PS1 pad or DualShock, DualAnalog or flightstick, but you are subject to the same compatibility problems the real thing might have had with any of these controllers. Generally speaking, DualShock with analogs off should be the most compatible. But your mileage may vary.

You select your controller on the input settings menu. When you have a PS1 pad + DPAD emulation you don’t have ANY analog control. You are just simulating the DPAD on the stick and there is no granularity in movement range at all.

In this mode pushing a bit or pushing a lot of an stick will just tell the core that the button is pushed, the game might have some logic to make it appear like analog control was used but the input is pure digital.

If you change to DualShock and enabled the sticks (either by disabling the Toggle button core option which will force analogs to be on or by using START+SELECT+L1+L2+R1+R2) on a game that supports DualShock you’ll get REAL full analog control.

Now, I don’t know what happens if you have dpad emulation enabled and DualShock at the same time. My guess is DualShock overrides this but I may be mistaken. I’ll have to that. Also bear in mind a game with DS support could have different actions for the stick and the hat.

Now to your questions.

I’m sorry I don’t know where you want to get at. You either do this: input_player1_left_axis = “-0” (use the joystick, digital or analog if supported) or this: input_player1_left_btn = “h0left” (Use d-pad, digital -or analog?-) what you mean is something like this?: input_player1_left_axis = “h0left”

If you do this: input_player1_left_axis = “-0”, that’s correct and it works on all scenarios. If you do

input_player1_left_btn = “h0left” , then that’s correct too, it makes the hat left work as hat left. This is wrong: input_player1_left_axis = “h0left” it will result on the analog stick to work like a digital button.

What dpad emulation does is accept whatever you have mapped to the left stick as it was the hat without changing ANYTHING in the config.

“Without doing anything”. I didn’t need to change device type back and forth between ps1 and DualShock to play on both types of games, 1 config plays both, as I said on analog too, Crash walks and runs if pushed further.

As I said, your mileage may vary. As far as I know Crash Bandicoot does NOT support the dualshock, it will work with DualShock with the sticks off I guess. Either that or it has some logic to make if appear as if there was analog controls or you’re playing Crash Bandicoot Warped that does support it. I haven’t played much Crash games so I don’t really know.

You should always use Dual Shock with analogs on and dpad emulation off on games that support it, and in the games that don’t support it you could use PS1 pad with Analog emulation or DualShock with sticks of and Analog emulation. End result is the same.

You should use the latest beetle core that one tells you at startup if analogs are on/off and it’s the only supported core at the moment

I know more (actually much more) than you might think. But in any case the help is appreciated. I have that pic and the other one (with the commands) inside my config folder and I’m continually looking it up (this whole afternoon for example). To begin with I never had a playstation, 1, 2, 3 or 4, so I’m really ignorant on their pads. Did the PS1 ever had a stick? I searched for it a few days ago, but it’s not something people tend to ask.

So if one wants to play how it was supposed to be, d-pad emulation should be always OFF, right? meaning RetroArch defaulting to either d-pad or stick. And when you want to play with stick for those systems/games that were d-pad only, you enable it. Basically an emulation “feature”, and moreover, shortcut, since one is already able to do this configuring buttons manually.

What I was saying is that I used device_type 517 (DualShock) and I could play either Crash 3 (Warped) and Castlevania, being the latter a no-DualShock game (or is it?). How I did it; instead of using the “analog_dpad_mode” I did it manually because in my head: manual dualshock setup > manual setup > analog_dpad_mode ( > manual dualshock setup?) The dualshock stick buttons/axis are separated from the main (PS1) stick buttons, so you can have both on the same config. Yet you want the analog_dpad_mode off for the DualShock games, right?. In this case the manual DS buttons will override the manual (PS1) stick buttons. This way you can play both types of games without doing strange toggle combinations, or at least that is what I wanted to explain in my post above. I can run more tests, but tomorrow, today is enough.

"Also bear in mind a game with DS support could have different actions for the stick and the hat. "

This could be the only problem I see, but it would really suprise me that PS1 era games used so many buttons. In this case one would want to try this: input_player1_left_btn = “h0left” input_player1_left_axis = “-0” The DS joystick overrides the “axis” set, and you can keep using the dpad.

I’m using the latest RetroArch build as I said above, 17-07-2014. The core is called medafen_psx, but the core options are registered as bettle_mednafenpsx, I bet it’s the latest core build.

It would be appreciated if you or any other can reproduce my reported bug above and confirm, at this point we should cover bugs first and foremost IMO.

Yes analog dpad emulation should be off for the “real experience”. Also it should always be off when you are trying to find out why stuff is not working as intended.

In any case, one config for non DS games and one for DS games would be the most sensible choice for people who use external frontends. PS1 pad with analog emulation (if you like controlling stuff with the sticks) for non-DS games, and DualShock without analog emulation and the Toggle option disabled for DS games.

Castlevania is not a DS game as far as I’ve tested.

About the bug, I guess you mean B button doing two different things. I wasn’t able to reproduce that and no one else has reported that so I don’t know.

That’s a bit painful to setup, AFAIK that would mean from the frontend point of view setting up a new system (with all the work that carries), so for me what works is what goes, when I get an issue, I might think what to do. I don’t have many games either (54)

You haven’t run through it, or have you expressly tested and couldn’t reproduce? You need to set input_autodetect_enable to true.

I have two setups, a clean setup with nothing configured (auto detect is on by default) where I test stuff, and my gaming setup. It didn’t happen on either of those

I’ll try again tonight

Ok, tested with a clean config, nothing configured at all, made sure input_autodetect_enable was true. Upon loading RA will detect my xbox 360 controller and autoconfigure all the buttons correctly.

Fired Castlevania on Mednafen, everything working perfectly. The sticks weren’t working as intended. Enabled d-pad emulation and it worked perfectly again.

Fired Megaman X6, same results.

Fired Tony Hawk’s Pro Skater 2 with PS1 pad, everything working, switched to Dual Shock and analogs now work for rotation as intended, switched the Toggle on and then did the ANALOG combo and they were disabled as they should, switched them back on and it still worked. Same tests with GT2 and I can confirm RUMBLE is working too.

Sorry mate not a bug. Try again on a totally clean config.

Ok, I started from scratch. My goal is to use one config for both types of games (ps1 and DualShock). With that on mind device must be set to 517 (DualShock). input_autodetect_enable option is not important if you override Auto buttons with manually defined ones, which I have done. input_player1_analog_dpad_mode is not important nor relevant here. beetle_psx_analog_toggle = “disabled”.

With this you start a DualShock game and works as expected, launch a PS1 game and it doesn’t. The toggle combo start+select+2 shoulder/trigger buttons won’t work in this condition.

So I don’t understand when you say:

Change to beetle_psx_analog_toggle = “enabled”, and the PS1 game works as expected, and DualShock game works as expected too. So this is how it should be configured. Now the above combo works, although I don’t see its use since everything works out of the box. PS1 works, when combo applied pad no longer response. For DualShock games when combo is executed it will change everything to digital.

So for me this is a wrap, until new issues arise. here’s my config: http://pastebin.com/6XHjdxwX