Yabause / yabause

Yabause is a Sega Saturn emulator.
http://yabause.org
362 stars 203 forks source link

X-Input peripherals! #283

Open jvhellraiser opened 8 years ago

jvhellraiser commented 8 years ago

Fix X-input on all controllers peripherals, how about that for a change.. we no longer use Crappy controllers anymore! most of the PC gamer's we use or either Xbox 360 controller or Xbox One controller or Fighting Sticks! when will Emulator developer's get it that we no longer use the PS2 controller with the adapter for the PC is so 90's

ghost commented 8 years ago

They "work" It's just really buggy. The stupid UI has a tendency to crash sometimes on my windows 10 machine when I'm changing controller settings. I noticed I had to set it to sdl input then clear the input settings to get it to work. Even then sometimes the buttons didn't map properly so I had to redo them. It's really lack of man power though, it's not their fault. There's only maybe one or two people working on it at most when they have free time. I'm not even sure if they have someone who knows QT well enough to fix this stuff

ghost commented 8 years ago

never mind, hilariously enough it actually stopped working. Not even sure how I got it working properly now

d356 commented 8 years ago

My Xbox 360 and One controllers seem to work fine with the SDL interface. I might be able to fix the issue if I can get some specific steps that cause the problem reliably, ideally from a fresh ini file.

ghost commented 8 years ago

Forgot i had an outdated INI (thanks) so I erased it then just set it up normally. It always launches into the bios because I THINK it's registering the wrong buttons when I configure it. This is an xbox 360 controller by the way

Input\Port\1\Id\1\Type=2 Input\Port\1\Id\1\Controller\2\Key\0=2097168 Input\Port\1\Id\1\Controller\2\Key\2=2097216 Input\Port\1\Id\1\Controller\2\Key\3=2097280 Input\Port\1\Id\1\Controller\2\Key\1=2097184 Input\Port\1\Id\1\Controller\2\Key\6=8 Input\Port\1\Id\1\Controller\2\Key\10=3 Input\Port\1\Id\1\Controller\2\Key\7=1 Input\Port\1\Id\1\Controller\2\Key\11=4 Input\Port\1\Id\1\Controller\2\Key\8=2 Input\Port\1\Id\1\Controller\2\Key\5=1114114 Input\Port\1\Id\1\Controller\2\Key\4=1048581 Input\Port\1\Id\1\Controller\2\Key\12=5 Input\Port\1\Id\1\Controller\2\Key\9=6

ghost commented 8 years ago

yup, just configured it again: Input\Port\1\Id\1\Controller\2\Key\0=2097168 Input\Port\1\Id\1\Controller\2\Key\2=2097216 Input\Port\1\Id\1\Controller\2\Key\3=2097280 Input\Port\1\Id\1\Controller\2\Key\1=2097184 Input\Port\1\Id\1\Controller\2\Key\6=8 Input\Port\1\Id\1\Controller\2\Key\10=3 Input\Port\1\Id\1\Controller\2\Key\7=1 Input\Port\1\Id\1\Controller\2\Key\11=4 Input\Port\1\Id\1\Controller\2\Key\8=2 Input\Port\1\Id\1\Controller\2\Key\12=5 Input\Port\1\Id\1\Controller\2\Key\9=6 Input\Port\1\Id\1\Controller\2\Key\5=1048578 Input\Port\1\Id\1\Controller\2\Key\4=1114117

Edit: Er maybe not. Why did 5 and 4 change? is that for the analogue triggers? Still doesn't explain why it launches into the bioses memory manager when I have the controller enabled. :/

ghost commented 8 years ago

Brought an xbox one controller to try it out. It'll assign all buttons as 1048578. So hm not sure if it's just windows itself or windows 10, but it's very broken

d356 commented 8 years ago

I see a couple of issues:

LT and RT are considered to be unpressed when SDL_JoystickGetAxis & 0x8000 is true, so if ( cur < -SDL_MEDIUM_AXIS_VALUE ) triggers and PerKeyDown occurs when it ought to be PerKeyUp.

persdljoy.c doesn't look for controllers that are newly synced or plugged in, so for it to work reliably the controller has to be ready before Yabause is started.

I've seen the bios issue before but I haven't been able to come up with an exact series of steps to reproduce the bug.

ghost commented 8 years ago

So for the xbox one controller it'll just assume LT and RT are always being pressed because the number is less than SDL_medium_axis_value? That's probably why all the buttons get set instantly in the controller config. I have a feeling I'm wrong about your explanation though.. I apologize if you thought I was a developer. I'm just an emulator fan who can barely compile stuff D:

jvhellraiser commented 8 years ago

I manage to configure the emulator but in a really weird way, i had to open and close the emulator and select add a controller button then close it and open the emulator and do another input until all the input are enter. Emulator wont refresh when config input? i guess. and even if you manage to do it this way it wont matter... controller goes bunkers once you start a game, tested on Radiant Silvergun.

cyberwarriorx commented 8 years ago

XInput should be fixed now: https://github.com/Yabause/yabause/commit/d386f4e136d69a164784a74107aace04d842f2b1

d356 commented 8 years ago

286 should fix the issue with unresponsive controls or going into the bios after configuring a controller.

d356 commented 8 years ago

287 fixes some more problems with xinput.

ghost commented 8 years ago

Sorry about before. Okay so it works better now. I can at least configure it now with a little weirdness and play a game. Is the enable bios emulation checkbox reversed or is it supposed to work like that? I had to uncheck it to allow the bios to boot when loading a game

d356 commented 8 years ago

The bios emulation checkbox has been updated to read "Enable Built-in HLE Bios". A real bios is used when the option is unchecked. If you have more specific info about the weirdness it might be possible to fix it.

ghost commented 8 years ago

Ah okay so it was working as intended. Not sure about all the problems I was having either, I got really frustrated trying to figure out how to recreate it and just gave up lol.

ghost commented 8 years ago

Hm so I might kind of have something though it probably wont help you at all. Basically I plugged my xbox one controller in while the emulator was running which I know I'm not supposed to do. It did it's usual thing where I click the controller graphic and it maps it to some phantom button. Here's where it gets strange. I closed the emulator then unplugged it and plugged it back in and it was still doing the same thing even after I reopened it, but I couldn't figure out how to recreate it,