libretro / virtualjaguar-libretro

Hard fork of Virtual Jaguar (abandoned project) to Libretro
31 stars 34 forks source link

[bug] Numpad 7, 8, 9, *, # input impossible for player 2 and above in RetroArch or P1 controllers. #54

Closed VideogameScrapbook closed 2 years ago

VideogameScrapbook commented 2 years ago

This is related to this issue, but that one is specifically about joypad mapping: https://github.com/libretro/virtualjaguar-libretro/issues/39

There's a workaround of using the keyboard number keys for player 1. But there is no such option for players 2 and above.

JoeMatt commented 2 years ago

Can you test with latest nightly. #59 was merged into master a few days ago. I'm hoping that improves the issue.

VideogameScrapbook commented 2 years ago

@JoeMatt , in order to test in RetroArch, what are the unique keys or Retropad buttons/axis for player 2 numpad 7-9*#?

JoeMatt commented 2 years ago

They're mappable as as controller. This is odd I know, but I actually use this core with a different UI since I'm an iOS dev so my input mapping isn't 1:1 with retro arches but the code to read them is there,

https://github.com/libretro/virtualjaguar-libretro/blob/3fd8160628295f5a21188f28548895a9a8a8955a/libretro.c#L383

I'm not sure how retro-arch handles keyboard input for 2player games so that might be a limitation of the front-end?

There was another bug in the core itself for decoding input buffers, so I wasn't sure if that was related to this or if this is purely the inability to map the input through retroarch the way you require for keyboard. (it should work with 2 controllers though)

edit: I'm an idiot, I just saw the code for controllers stops at digit #6 so yes, they're unmappable.

I'm not sure if that's a retro-arch restriction though since I'm new to libretro.h

JoeMatt commented 2 years ago

63 adds extra code to map the keyboard keys q -> p,[,] to 1 -> 0,-,=

JoeMatt commented 2 years ago

Unfortunately I don't see a way to map the keys to a controller since the enums used internally for libretro.h stop after key_6 (r3).

I'm trying to find if other cores have a work around, since it's not the only system with a numbered input, ColecoVision, Atari 5200

Though they both have less buttons overall since they only have 1 or 2 non numbered buttons.

VideogameScrapbook commented 2 years ago

@JoeMatt What about using the right stick axis, is that possible?

JoeMatt commented 2 years ago

@JoeMatt What about using the right stick axis, is that possible?

Still not enough buttons by 1, unless there's more that's unmapped.

I was talking with the main libretro team about maybe just expanding the enum for extra buttons since it shouldn't affect other cores building against an updated enum since it's already pre-defined for 255 length.