schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
731 stars 61 forks source link

Enhancement - Allow binding of full keyboard with "Custom Keyboard + First DOS joystick" (real example) #456

Open AleWin32 opened 6 months ago

AleWin32 commented 6 months ago

I think I noticed a problem that couldn't be resolved, but I think here is the solution: add a new "Device Type" (combination of two of them).

This is similar to this requested enhancement that was successfully implemented at the end: https://github.com/schellingb/dosbox-pure/issues/54

MicroMachines 2 Turbo Tournament for PC (MSDOS) has a 4 players gameplay that's very funny for playing 4 friends, for example with a Raspberry Pi and 4 USB gamepads.

The problem is that for 4 players, the main menu is controlled by player 1 with keyboard: Arrow keys: to move through the items menu Enter: accept that item menu Esc: back to previous menu

but when ingame, player1 is forced to use the joystick (yes, just 4 keys for all): ACCELERATE: JOY1 A BRAKE: JOY1 B LEFT: JOY1 L RIGHT: JOY1 R

and there is no option to redefine keys. So, a combination of keyboard and joystick is needed for player1 to manage menus (to select a 4 players game) and to play the game.

Some other MSDOS multiplayer games, don't have this problem as they manage more efficiently because they use arrow keys to move through the main menu and through ingame, so there is no problem, but MicroMachines 2 (and possibly others when 4 playing 4 players) use different controls for main menu and for ingame.

Ok, so since we only need the keyboard arrow keys to move through the main menu of the game, and we don't want a USB keyboard attached to the Raspberry only for that, the perfect solution will be a new "Device Type" like "Custom Keyboard + First DOS joystick" with these mappings:

Hat up: Keyboard Up (to move through the menu) Hat down: Keyboard Down (to move through the menu) Select button: Esc (back in menus) Start button: Enter (accept in menus)

Hat left: JOY1 Left (ingame, turn left) Hat right: JOY1 Right (ingame, turn right) Button 0: JOY1 A (ingame, accelerate) Button 1: JOY1 B (ingame, brake)

AleWin32 commented 6 months ago

This are the only 3 ways to play 4 players: MicroMachines 2 - 4 Players controls (3 methods)

"AUTO" means that the car is always accelerating (actually not the best method as we cannot control the acceleration with accuracy)

schellingb commented 6 months ago

Have you used the Gamepad Mapper? It is even available in-game by opening the On-Screen Keyboard (with L3) and then clicking PAD MAPPER. In there you can customize all controller ports very detailed. You can map multiple functions to the same button/direction and thus make (for example) a single D-Pad direction do both arrow key presses and joystick movement. This should provide everything you need I think. Can you try that?

AleWin32 commented 6 months ago

Hi @schellingb, i tried what you told me and it works, thanks! Using the gamepad mapper (PAD MAPPER) is perfect now, i can move around the game menus and play the game with the same gamepad with a single remapping.

Can you add to the documentation (https://github.com/schellingb/dosbox-pure#gamepad-mapper) that a file named "PADMAP.DBP" will be created on the program folder executed by DOSBox-Pure? I spent some time trying to find where the remapping keys were saved.