libretro / libretro-cap32

caprice32 4.2.0 libretro
21 stars 34 forks source link

cap32: add joystick button fire3 #130

Closed revvv closed 1 year ago

revvv commented 1 year ago

Amstrad joysticks have three fire buttons. I added the missing fire3 button.

I have tested the code on my 3DS.

New button layout: A = fire1 B = fire2 X = fire3 (previously unused) Y = fire1 (previously mapped to space)

@DSkywalk Please verify ;-) The key codes in retro_events.h are not used in a remap file, so IMHO it's ok to shift them.

DSkywalk commented 1 year ago

imagen The atari standard usually only allows two buttons because one pin carries 5v.

Please can you tell me which controller (no hombrew) that works on an real amstrad has 3 buttons.

Thanks :bow:

DSkywalk commented 1 year ago

Also having the default space on the controller helps in the selection of many game menus. That mapping has been done that way for a reason and it is very important to keep it :+1:

As far as I'm concerned this commit is invalid, but if you find a game/cpc that works with 3 buttons, you can reopen it without any problem and we'll discuss it further.

Thanks again @revvv :)

revvv commented 1 year ago

The atari standard usually only allows two buttons because one pin carries 5v.

The Atari standard only allows one button, but I'm talking about Amstrad and there is no 5V output on the Amstrad joystick connector

Please can you tell me which controller (no hombrew) that works on an real amstrad has 3 buttons.

Good question ;-) I have only found the AMX mouse. Do modded joysticks count? I have modded my Competition Pro Retro and it works perfectly with ?joy(0) for example.

Also having the default space on the controller helps in the selection of many game menus.

Well, if you like. There are other unbound RetroPad buttons like L, R,Start, Select etc. Off topic: 1, 2, ENTER etc could also be helpful for some games...

if you find a game/cpc that works with 3 buttons

Many games offer to reconfigure your buttons. Sometimes you can configure fire3.

revvv commented 1 year ago

And note that fire3 is already in the current code for player1 and player2:

   CPC_KEY_SPARE                  = 0x96,
   ...
   CPC_KEY_JOY2_FIRE3             = 0x66, // just DIY JOYSTICK

I just renamed CPC_KEY_SPARE to CPC_KEY_JOY_FIRE3 So 4 years ago you were aware of fire3 ;-)

DSkywalk commented 1 year ago

Well, if you like. There are other unbound RetroPad buttons like L, R,Start, Select etc. Off topic: 1, 2, ENTER etc could also be helpful for some games...

Please note that we have been working for a year to create configurations (see RMP/clean-cpc-db) for the games and change the button configuration now would break many of them and they would have to be redone. This part is very critical :+1:

DSkywalk commented 1 year ago

I agree to add it to the JOYSTICK CFG ( AUTO ) in the X button and document it properly, but the other changes should be reverted. Thank you again @revvv :)

LibretroAdmin commented 1 year ago

Hi @DSkywalk , leaving it entirely in your hands as to how to proceed. You can decide to merge PRs as you see fit for this repo

DSkywalk commented 1 year ago

Hello @LibretroAdmin :)

Before proceeding, I will need to check that everything is working properly. However, Thank you for all your trust in my vision and support during this time :heart:

DSkywalk commented 1 year ago

Tested OK :)

revvv commented 1 year ago

Tested nightly Windows x64 build: OK Thank you!!!