kodi-game / game.libretro.prboom

Port of PrBoom (short for "Professor Boom") to libretro - plays Doom, Doom II, Final Doom and other Doom IWAD mods.
https://github.com/libretro/libretro-prboom
1 stars 4 forks source link

Can't use dual analog controls (controller is set to RETROPAD_CLASSIC) #7

Closed Ferk closed 5 years ago

Ferk commented 5 years ago

When loading this core in Retroarch there are two controller configurations available: RETROPAD_CLASSIC and RETROPAD_MODERN

https://github.com/libretro/libretro-prboom/blob/master/libretro/libretro.c#L84-L85

RETROPAD_CLASSIC is meant for SNES-like gamepads, the analogs are disabled and it's meant to control like in the SNES version of Doom, which is kind of awkward by modern 3D FPS standards. This is however the setting that it's being used in the Kodi addon. In Retroarch it's possible to change this, however not in this Kodi add-on.

From the logs, I can I see the line Invalid device, setting type to RETROPAD_CLASSIC. Given that the default "kodi gamepad" controller (which I think is the controller configuration used in this core) appears to have analog support, it would make more sense for it to use the RETROPAD_MODERN with actual support for analog controls, with similar layout as the Playstation version of Doom.

Below the relevant log section:

06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Setting port "1" (libretro port 0) to controller "" (libretro device ID 0)
06:03:14.531 T:281473126712912   ERROR: AddOnLog: Doom (PrBoom): [libretro]: Invalid device, setting type to RETROPAD_CLASSIC ...
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Libretro input bindings:
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): ------------------------------------------------------------
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_LEFT, Description: D-Pad Left
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_UP, Description: D-Pad Up
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_DOWN, Description: D-Pad Down
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_RIGHT, Description: D-Pad Right
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_B, Description: Strafe
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_A, Description: Use
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_X, Description: Fire
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_Y, Description: Run
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_L, Description: Strafe Left
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_R, Description: Strafe Right
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_L2, Description: Previous Weapon
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_R2, Description: Next Weapon
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_L3, Description: Toggle Run
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_R3, Description: 180 Turn
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_SELECT, Description: Show/Hide Map
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): Port: 0, Device: RETRO_DEVICE_JOYPAD, Feature: RETRO_DEVICE_ID_JOYPAD_START, Description: Show/Hide Menu
06:03:14.531 T:281473126712912   DEBUG: AddOnLog: Doom (PrBoom): ------------------------------------------------------------

I suspect this requires creating a topology.xml, sort of how it's done in game.libretro.beetle-psx: https://github.com/kodi-game/game.libretro.beetle-psx/blob/master/game.libretro.beetle-psx/resources/topology.xml

But it's not clear to me what controller plugins shall be used.

Ferk commented 5 years ago

I figured out that it's not topology.xml what needed to change but the controller definition in buttonmap.xml

It'd be best if it was possible to have both configurations be switchable, though. But I'm not sure how to do that, would we have to define a new console-agnostic analog-less controller plugin? And even then, is it even possible from the GUI to switch the controller plugin that's being used?

garbear commented 5 years ago

Good find in your PR. Regaring switching configurations, I started working on a Player Manager (https://github.com/garbear/xbmc/issues/87) to allow switching controllers in a generic way, but as you can see I haven't finished this project yet. It turned out to be a huge project, if you have any simpler ideas on how to change controllers that'd be appreciated.