jsgroth / jgenesis

Sega Genesis / Sega CD / SNES / Master System / Game Gear emulator
MIT License
74 stars 4 forks source link

Sega Genesis Control Issue and Stuttering. #135

Open QuietFrog2033 opened 1 week ago

QuietFrog2033 commented 1 week ago

Hi, I am not sure if this is the right place to put this but, I'll give it a go. I Start up jgenesis-0.8.1-windows-x86_64 and try to play Streets of Rage 2. When I play it I am using my Bluetooth 8-BitDo M30. When I lay out the buttons I am doing it correctly but, when I go to jump in the game it's C button. Punch is button B. When I go back to punch it thinks I am using both buttons which does a leg sweep.

I can't seem to get my punch button back again. It's like once I hit the jump button button C then I can't ever use the B button as punch. However, I can hold C button and hit the B button which does punch like normal but for whatever reason I can't use the B button alone anymore for punch. It only can be done while holding C and then hitting B. I don't know if this is a bug or I am doing something wrong.

Last issue here, sometimes my Genesis games will stutter. I don't know if it's' me doing that with options but, it will stutter for some reason. It will take a little bit then clear up then I can play for a little bit and then it will slow and stutter again. I don't know what is going on as I am new to this emulator. I normally use Kega Fusion.

jsgroth commented 1 week ago

Hi,

Regarding the controls issue, I don't have an M30 and I'm not able to reproduce this with any of my controllers (including an 8BitDo SN30 Pro), but it definitely sounds like an issue in the emulator reading the controller inputs, like it's reading the C button inverted or something. It's really strange that it only seems to happen for one button - I'd expect an issue like this to happen for every button or none of them. I could try changing the gamepad implementation to poll the current SDL controller state instead of processing SDL controller events, but beyond that I'm not currently sure what I can do to fix this. I know the 8BitDo controllers have different modes (e.g. DInput / XInput / Switch) - have you tried switching the controller to a different mode to see if that helps at all?

Regarding the stuttering, is it slowing down (including audio stutter) or does it just look really choppy when it stutters? If it's actually slowing down then I would try disabling VSync in the video settings (I should probably have it disabled by default really). If it's choppy then you could try enabling VSync, and if you're on Windows you could also try changing the wgpu backend to DirectX 12 - from my experience it seems to work a little better than the default Vulkan backend on Windows, although it probably depends on your GPU and drivers.

Improving the frame pacing when VSync is disabled is definitely something I want to fix - right now it seems to work well on some platforms/configurations but not so well on others. I haven't had much luck with the things I've tried so far though.

QuietFrog2033 commented 6 days ago

Hello, hope you are having a great day. I'd like to say thank you for being so kind as to answer me and be so helpful. I sincerely appreciate that, and I wanted to let you know that before I give my answers. Ok, so the Controller I use is the 8Bit Do M30 it's a Sega Genesis style controller. In particular the 6-button style layout. This gamepad uses Bluetooth and is meant for Windows, Mac and Mobile phones both Android and Apple iPhone. On it is only the button to pair that's it for the controller. There are three buttons in the center but those are for mobile use. A Star, a minus symbol and a Heart symbol. Unfortunately, there isn't a switch to toggle on the controller.

As for the stuttering I will tell you what I tried. So, when booting up any game they all work so far as I tested. When I encountered the stuttering the first thing I did was to check the video settings. They were "out of the box" settings. Auto on most things and the rendering backends I have available are: Vulkan, DirectX 12, and OpenGL. Now, when I was playing a game, and it would do the problem.

I would quit and change the settings. I went with every single one of those options and it still had the issue. No matter what I did. As for Vsync, basically same outcome. It would still do it and while I did notice a smoother or less smooth affect when toggling the Vsync it really didn't do much of anything to fix it. To save you reading time here, The rest of the options resulted in the same with just different styles of things going on in addition. Like interpolation etc.

As for what it is doing. When I start a game like Super Street Fighter 2 The New challengers. The opening scene is great, smooth and looks good and the menus and selecting your character and all of that is great. When I get to a stage like this example. I will choose Ken, and it will go to Ryu's stage to face Ryu. I will throw my first fireball but after that if I don't get that move off first or really any move. The game will stutter and slow and the audio will go with it. It will sound like stuttering and the game will slow to a crawl. It's almost like in other Emulators where they compile shaders, and it slows for a moment.

But that's not what is going on here. We aren't compiling shaders for GameCube or PS3. We are talking about a 16-bit system. So, it will do this slow down and stutter sound in the game and in a minute, it clears up and you can play it again. Then it will do it again and you have to wait, and it can be frustrating as the next stage vs Chun-li you are trying to upper cut her while she does her Spin by the Feet or whatever move, and it does it and she beats you.

So far this happens on any game that I have tested. They all have this issue of stuttering audio while slowing to a crawl and you have to wait for it to stop before you can play it again. I tried even starting the emulator with Windows compatibility mode to see if other windows vers would work. Nah, Same thing. I want to again say Thank you for taking the time to respond and for sitting through all of this text here. I wanted to be as honest as I could be and tell you what's happening in the best way I could. So, thank you for reading all of this. I know it's a lot. I hope anything I said can be helpful for you. I think what you are doing is a great thing for emulation and preservation and I love it very much.

jsgroth commented 4 days ago

What I meant by the M30 having different modes is that I think you can hold different buttons while powering it on to change what gamepad protocol it uses, if it's like 8BitDo's other wireless controllers. On the SN30 Pro for example you can hold X+Start for XInput, B+Start for DirectInput, Y+Start for Switch mode, and A+Start for MacOS mode. This shouldn't make a huge difference (at least for XInput vs. DirectInput), but it's something you could try.

I might get an M30 myself to see if I can reproduce this - I already have a USB controller that works really well for Genesis/Saturn but it would be nice to have a wireless option too.

Thanks for the detail on the slowdown. It still sounds to me like either a sync issue or possibly a performance issue, though if it was performance-related then I would expect it to almost never run at full speed instead of sometimes slowing down and sometimes running at full speed.

Here are some other things you could try:

If audio sync ends up being the problem then I would try both decreasing the audio device queue size (32 or 64 should work fine) and increasing the audio sync threshold (20000 or so gives a larger buffer without increasing audio latency too much). I'm planning on changing the default values for these settings in the next release anyway as part of some tweaks to the audio playback code.