ares-emulator / ares

ares is a cross-platform, open source, multi-system emulator, focusing on accuracy and preservation.
https://ares-emu.net
Other
931 stars 114 forks source link

[Feature Request] N64 Support for direct controller communication #272

Open osaeed18 opened 2 years ago

osaeed18 commented 2 years ago

I would like to know if Ares could implement direct controller communication by raphnetraw, which allows the game talk to the Nintendo 64 controller directly as it reads exactly the same axis values as it would on a real N64 console. In the drivers menu, there could be a checkbox option for raphnetraw to enable the plugin and the user can simply plug their Nintendo 64 controller to the raphnet N64 to USB adapter V3 adapter and run the game without having to configure the controller inputs. This would also support the rumblepack, N64 mempak, and Transfer pak without any configuration needed. Further information about raphnetraw https://www.raphnet-tech.com/products/raphnetraw/ https://www.raphnet.net/programmation/mupen64plus-input-raphnetraw/index_en.php

LukeUsher commented 2 years ago

Sadly, we can't make use of any code from raphnetraw due to licensing conflicts: the plugin is licensed under GPLv2, but ares is an ISC licensed project... if we were to implement such functionality, we'd have to build it from scratch.

Due to this, I don't see it happening anytime soon, but I will keep this issue open.

jeffythedragonslayer commented 2 years ago

Please email me if you have any advice on how I can get started implementing this. I have a retrolink USB N64 controller that ares does not recognize that I would like to use.

raphnet commented 2 years ago

@LukeUsher I am the author and copyright owner of the raphnetraw plugin. Actually I would not mind relicensing it under the ISC license if necessary. My code depends on hidapi to communicate with the adapter, and hidapi has compatible licensing I believe? https://github.com/libusb/hidapi/blob/master/LICENSE.txt

However I think I'd like to actually try to add direct controller support myself. So the code I would contribute would be automatically ISC-licensed and I am fine with that, even if some of it is reused from my plugin. So perhaps I do not need to re-license my plugin then?

The way I see it, it would be easier to integrate this directly into ares rather than using a plugin dll/.so approach. I think I would simply begin by making a new controller type called "raphnetraw" (at the same level as gamepad or mouse)

What do you think?

LukeUsher commented 2 years ago

@raphnet adding direct support for raphnetraw as a device type sounds like a great idea to me, just make sure to update the LICENSE file to add the license information for libhsb/hidapi

osaeed18 commented 1 year ago

Hi @raphnet, have you been to able to work on adding direct controller support code for Ares?