I am writing a libretro version for the AppleWin emulator and I am a bit confused on how to handle input.
I am currently calling RETRO_ENVIRONMENT_SET_CONTROLLER_INFO
passing a { "Nintendo DS", RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 0) }
Then I am not sure what the role of retro_set_controller_port_device
is and I am totally ignoring.
It would log something like Plugging device 1 into port 0.
Afterwards I can call input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, ...)
and it works.
In all of this, it is not clear what port, device, index and id exactly refer to. Everything being an unsigned
and a #define
does not help.
Now I tried to change RETRO_DEVICE_JOYPAD
to RETRO_DEVICE_ANALOG
and nothing really changed. I still see Plugging device 1 into port 0.
Even after I changed in retroarch the device type, the call back is still for device 1.
I seem to understand that the 1 in retro_set_controller_port_device
means the same 1 as in #define RETRO_DEVICE_JOYPAD 1
?
A lot of confusion in my head at the moment. A lot of examples are out there but they are very complicated and probably do a lot more that I need so I am not sure I should follow them.
If I could understand the real meaning of port, device, that would help.
Cheers.