higan-emu / higan

higan is a multi-system emulator focused on accuracy, preservation, and configurability.
Other
1.16k stars 111 forks source link

Mouse/lightgun support and autohookup in byuu #30

Open FitzRoyX opened 4 years ago

FitzRoyX commented 4 years ago

So I have a preliminary controller database here in line-per-entry CSV format. Each line has 4 fields. Field 2 identifies the game for db maintenance. Fields 1, 3, and 4 are intended to be used by the emulator. Field 1 is the game hash, field 3 tells the emulator what special controller is supported, and field 4 tells it whether it is optional or required. Note that the weird controllers (BatterUP, Barcode, TeeV Golf) are just here for posterity. I'm also missing checksums for NES games because I need to figure out how to isolate the data and not create checksums that are header-specific.

specialcontroller_db2.txt

The emulator already knows port stuff behind the scenes (mouse = port 1, super scope = port 2). So that doesn't really need its own field.

The big win here should be that when the emulator detects a game that requires a special controller (Metal Combat, Lethal Enforcers, Mario Paint) it should just work using this system. The user will still have to use his capture mouse hotkey, but he won't have to manually hook and unhook controllers between games, or even know which games require which special controller.

For optional controllers, all we need is a boolean advanced setting that amounts to "Use mouse when supported". If a game optionally supported either the mouse or super scope, just go with the mouse.

There are a couple of games that did weird stuff like supporting a mouse in a supplementary fashion for minigames. We don't need to worry about that right now. But if it were to be supported in the future, it can be called "Supplementary" and require a modern pad (thumbsticks, dual triggers) to automap both port1 and port2 functions to the user pad.

edit: forgot justifier game section in db, now fixed

Screwtapello commented 4 years ago

I would love to have automatic controller configuration in byuu and bsnes, and maybe even in higan. Thank you very much for sorting out this database of which games would benefit from it.

I don't have the expertise to implement this myself, so I'm marking this issue "help wanted" in case somebody wants to tackle it.

Kawa-oneechan commented 4 years ago

I might be able to do it — I can think of a reasonable possible way to implement this right now in fact — but I'd have to be able to compile the thing first.