ekeeke / Genesis-Plus-GX

An enhanced port of Genesis Plus - accurate & portable Sega 8/16 bit emulator
Other
673 stars 193 forks source link

[Wii] [bug] Numchuck joystick goes bananas in the menu #507

Closed Sowden closed 1 year ago

Sowden commented 1 year ago

Hey ho there. I found this in a very complicated manner. But I witled it down to something simple, and I found the root of the problem. Whenever I use the Numchuck joystick in the menus, it goes bezerk. It's hard to describe just where it fails and just when it goes haywire. Because it doesn't seem to be pure up, down. I think it's when you turn it to the sides? I dono, you'll have to see it for yourself. If I use the Wiimote to map the buttons and Numchuck joystick, it works great in the game. It's just the menus that becomes inoperable. Take a look and let me know if there's anything more I can give you to spell out my problem. Thanks.

ekeeke commented 1 year ago

There was indeed a regression introduced in this commit which would cause various issues in menu navigation when using analog sticks.

This should now be fixed by this commit: https://github.com/ekeeke/Genesis-Plus-GX/commit/60f2281fc383e49e1b224ed14f9cfcfadfd0c849

Thanks for the report

Sowden commented 1 year ago

Thanks for looking at this. It got... better... I think this is the way I would describe it. Say the first menu screen. When you two over, it moves over once. So with three buttons, to get to "Exit" I would tap it twice on the Wiimote d-pad. What the Numchuck joystick is doing, is that it doesn't move on a simple tap over. In fact it doesn't move at all. So to move it, I need to hold the joystick to the right for about two and a half seconds (it feels like) and it jolts to the end of the menu, just like it does on the Wiimote d-pad. So could we make it to there when we move the Numchuck joystick over once then that makes it move once? Instead of holding it to jolt over? It makes it kind of hard to hit certain buttons if I'm bolting up and down or left and right. Now I'm no coder, so I don't even know if what I just asked for is possible. But just wondering if it can be done. Thanks man.

ekeeke commented 1 year ago

That's the way it always has been. The analog stick is for fast scrolling (by holding up a direction), it is a design choice (and is the same with classic controller analog sticks).

It could have be done differently so analog stick acts like directional buttons but it is more complicated than with buttons (which can report a "not pressed -> pressed" transition) as inputs are checked every frame (each 1/60 seconds) so I cannot just detect every frame that analog stick is moved to one direction or the selected item will continuously move during the time you hold the stick. I would need to detect the sticks are moved, then wait until they return to 'middle' state to start detecting their movement again. This is more complex code and would prevent fast scrolling (when browsing files or cheat codes) using sticks so I prefer it the way it is actually designed.

Sowden commented 1 year ago

Ok, I mentioned before that I got here in a complicated way. So here it goes. I'm using a device coded with Blueretro on my Wii U. It's a device called Retro Rossetta and it is connected to the Wiimote using the plug extension. I am then using both a N64 NSO and a 8bitdo Genesis DIY board replacement. The problem I'm having is that I can't change any of the mapping on either of the controllers, for other complications that's not worth getting into, and the 8bitdo controller board has its d-pad mapped to the Numchuck joystick (for some odd reason). So I'm kind if stuck with using the Numchuck joystick on my 8bitdo board to navigate your menu options. So I guess I'm asking for a request for an enhancement? If it's too complicated, then that's gravy.

Sowden commented 1 year ago

You know what, never mind. I figured out the solution to my problem. Thanks for fixing the bug for me man!

ekeeke commented 1 year ago

I didn't know about BlueRetro devices, this looks interesting. From their github, it seems that the Wii adapter is acting as a classic controller though, not nunchuk controller (the problem with analog stick would be the same though, as explained above).

Anyway, looking at 8bitdo diy kit documentation, it seems it supports various controller mode (Xinput, Dinput,...) so maybe switching between them will make MD directional buttons appear as buttons, not analog directions.

On last resort, the solution is obviously to use the Wiimote D-PAD to navigate the menu.

Sowden commented 1 year ago

Yeah, it does emulate a Classic Controller. I was just using the Numchuck just to keep things simple. The Wii-Ext is the absolute only way to get it into the Wii U. The Wii has some options. It can use the Wii-Ext like I'm using or it can use the Gamecube port. As of right now, there are only cheap receivers being sold on alliexpress (that no one should support, in my opinion). But towards the end of the year, Stone Age Gamer are going to be selling some quality receivers.

I solved my problem with my 8bitdo controller though. I had.all of my controllers set to Switch mode since I was using the N64 NSO controller. And the problem was for some reason the d-pad was controlling the Classic Controler (or the Numchuck) left joystick. So I had to read the 8bitdo manual and discovered with some button combinations, I could swap what buttons control what, which is pretty damn cool. So I changed d-pad to d-pad (why would it ever be anything else?) and now my N64 and 8bitdo Genesis controller are in perfect sync. And I'm gonna get a 8bitdo NES and my PS4 controller to work with other emulators soon!

But yeah, check out that Blueretro project. I own two Retro Rosetta's now. One for my Wii U and another for my Atari computers. That way I can use my N64 and a wireless bluetooth mouse with my Atari ST. Pretty damn cool.