MiSTer-devel / Main_MiSTer

Main MiSTer binary and Wiki
GNU General Public License v3.0
3.02k stars 325 forks source link

[Feature Request] An option for disallowing "illegal" input sequences on a D-Pad, such as Left+Right and Up+Down #658

Open EricICX opened 2 years ago

EricICX commented 2 years ago

Some emulators of 8/16 bit consoles which originally included controllers with a D-Pad, such as the NES and SNES, include an option for the inputs Left+Right/Up+Down to not be allowed on a keyboard. These inputs are impossible to do on an unmodified D-Pad, and as such, many speedrunning communities, such as Super Mario Bros, have required these inputs to be disallowed if you are using a keyboard with an emulator.

image

Some games for these consoles are also not designed to handle these inputs, and exhibit extremely wacky behavior if they receive them. A great example is Zelda II, and most people familiar with the NES have likely seen TASes of the game where Link can go faster than the NES can keep up with if Left+Right is pressed.

What I am asking for is an option, perhaps during keyboard input configuration, or somewhere else, for Left+Right and Up+Down to be disallowed. It does not have to be forced, but I would like it to be an option for speedrunners / casual players who would like it. (Emulators usually resolve these inputs to nothing)

sorgelig commented 2 years ago

It will add unwanted complexity to already complex input module. It's not only about disallow, it's about tracking what button was pressed first and which released first. I suggest to use a gemepad not allowing to press opposite directions. There is no such target for MiSTer to make a speedrunner device. It's for casual/normal play.

EricICX commented 2 years ago

It's not only about disallow, it's about tracking what button was pressed first and which released first.

I'm not much of a programmer, but how hard would it be to check if two buttons are pressed, and if so, tell a core that neither button is pressed?

dshadoff commented 2 years ago

I don't understand the reason for the request in the first place. As you yourself say, these buttons are impossible to create on an unmodified pad. And some games will do wacky things when they see these 'impossible' inputs. MiSTer is only replicating the real hardware, so it will also do these things. This identical reproduction of behaviour is a design goal.

I should also mention that certain controller types on certain machines deliberately use these combinations in order to be identified by the console's software; for example, on PC Engine, a 6-button controller is identified by showing this illegal combination every second scan (up + down + left + right). We don't want to get into a situation where users configure these illegal commands to be off, then get confused (and require support) when it impacts other functionality.

Likewise, I anticipate there would be discussions and arguments about what specific behaviour to implement (i.e. register neither key ? Prioritize one ? Add even more configurations ?)

It seems that this a request in order to be able to use a modified controller, but to disguise this fact. So, since the controller itself was already modified once, why is it not possible to further modify the controller itself to signal the outputs you deem appropriate ?

EricICX commented 2 years ago

I don't understand the reason for the request in the first place.

The reason for this request, and the reason that L+R and U+D is disallowed for speedrunning most NES/SNES games, is so that players who prefer to use a keyboard for speedrunning certain games for the NES and SNES do not have an unfair advantage over players using an original controller. It's been this way basically since the dawn of speedrunning the NES games that I play, anyway.

This identical reproduction of behaviour is a design goal.

If that's the case, then this issue should be closed. However, since in my mind this is a very small change in input handling and it's the only thing preventing this console from being suitable for speedrunning many games with a keyboard (it has very accurate NES and SNES emulation otherwise), I still think it should be implemented.

I should also mention that certain controller types on certain machines deliberately use these combinations in order to be identified by the console's software

It likely shouldn't be on by default, and should be tucked away in a menu somewhere for the people that need it in this case.

Likewise, I anticipate there would be discussions and arguments about what specific behaviour to implement (i.e. register neither key ? Prioritize one ? Add even more configurations ?)

What I am requesting is that it registers neither key. This is the simplest way of handling illegal inputs, it's the way that most other emulators do it, and it's the way that most speedrunning communities that allow players to use an emulator and keyboard have standardized on.

It seems that this a request in order to be able to use a modified controller, but to disguise this fact. So, since the controller itself was already modified once, why is it not possible to further modify the controller itself to signal the outputs you deem appropriate ?

An unmodified keyboard, which is what my suggestion is based around, does not have options for disallowing these inputs by itself, and modding it to do this would not be a trivial task. Also, a keyboard is a perfectly legal way to speedrun many games and the fact that you use one does not need to be disguised in many speedrunning communities, but only if the emulator does not allow inputs that would be illegal on a controller, which is the reason for my suggestion. Ultimately, I would like this to be implemented so that the MiSTer can be an option for people who want to speedrun NES/SNES games with keyboards, but I also believe it would have other benefits as well.

ZachArani commented 2 years ago

I agree with EricICX here...at least on the grounds that including this function in relevant (read: NES) cores is not against the spirit of the MiSTer. After all, these cores allow plenty of user customizable features such as allowing extra sprites without flicker or even arbitrarily picking palettes. The core might strive for academic accuracy but there's still plenty of inaccurate quality of life features for each core.

However...when it comes to how difficult it would be to implement vs how useful it would be to the community at large--I have to also agree with sorgelig here. If there's a large enough push from the speedrunning community to use MiSTers as speedrunning devices, then perhaps someone from said community could contribute such a feature to the relevant cores. But I can't see this being useful or worth putting the time into if you are a lead developer.