About the input system

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome. Not for end-user support.
Forum rules
Keep it classy!
  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!
Post Reply
segaduck
Posts: 14
Joined: Fri Nov 17, 2023 2:49 am

About the input system

Post by segaduck »

Hi, everyone.

I've started up a new project to develop a new GUI frontend for Supermodel emulator by using C#.net and I would like to implement a UI for input-config mapping user interface.
I've already figure out how to get DirectInput, Xinput, Keyboard ...etc. and how to write into config.ini with C# library. However, I have not found a good way to mapping the naming system of inputs in C# library to the naming in Supermodel.

I've tried to read the input system source code but it's really too hard for me to understand them all.
I've even tried to call "supermodel -config-inputs" command prompt to get the text message back to C# but failed.

Any good suggestion? Is there any possible to pack the input system codes of Supermodel as a library in C# for better integration of the UI code?

Thank you.
Bart
Site Admin
Posts: 87
Joined: Tue Nov 07, 2023 5:50 am

Re: About the input system

Post by Bart »

The input system naming convention is assembled from peripheral identifiers (like "JOY") and labels for axes and buttons. They're all contained here.
segaduck
Posts: 14
Joined: Fri Nov 17, 2023 2:49 am

Re: About the input system

Post by segaduck »

Let me study the whole source code of input.cpp first.
I am thinking of recompiling the source code and use it as an library in C#.

Thank you.
Bart
Site Admin
Posts: 87
Joined: Tue Nov 07, 2023 5:50 am

Re: About the input system

Post by Bart »

That is a wild idea but if you can pull it off, would be great. Note this will require that you open source your front end under the same GPLv3 license. Hopefully it's sufficiently well encapsulated and independent from the rest of Supermodel that you could include Supermodel as a git submodule as opposed to copying the files, modifying them, and risking them getting out of sync in the future. If you notice any ways we could improve the encapsulation of the input system, please let us know.
segaduck
Posts: 14
Joined: Fri Nov 17, 2023 2:49 am

Re: About the input system

Post by segaduck »

I am using c# WPF to write a new frontend from scratch.
I would like to upload all my source codes to Github without any problem for sure. However, what I am thinking is much simpler. The solution I am thinking is as following:

UI controller input --> c# frontend code --> call input.cpp as a dll library --> get the response string --> write back to config.ini --> c# frontend code --> represent the input setting result to UI

Wish it will work well.
Post Reply