libretro / libretro-cap32

caprice32 4.2.0 libretro
21 stars 36 forks source link

a new keyboard/joy process #47

Closed DSkywalk closed 5 years ago

DSkywalk commented 5 years ago

Hello!! I am developing a new functions for joystick/keyboard.

imagen

If a game have a bizarre config, remember you could use [controls] menu as usual :keyboard: (fixed in 7bcd4865fcadcef2a381e7db2c1104275cf30a87 )

With the new behavior I'm trying to simplify the joy code, but it would be great to hear your comments. :+1:

JOY CONFIG 1

JOY BUTTON CPC
B FIRE1
Y SPACE
START J (to select [J]OYSTICK on game-menu)
DPAD-UP JOY-UP
DPAD-DOWN JOY-DW
DPAD-LEFT JOY-LEFT
DPAD-RIGHT JOY-RIGHT
A FIRE2
X S
- -
L INTRO
R SHIFT
L2 CTRL
R2 COPY

JOY CONFIG 2

JOY BUTTON CPC
B F1
Y F2
START K (to select [K]EYBOARD on game-menu)
DPAD-UP Q
DPAD-DOWN A
DPAD-LEFT O
DPAD-RIGHT P
A SPACE
X H
- -
L INTRO
R SHIFT
L2 CTRL
R2 COPY

JOY CONFIG 3 (GENERAL KEYB/INCENTIVE GAMES)

JOY BUTTON CPC
B SPACE
Y W
START F
DPAD-UP CURSOR-UP
DPAD-DOWN CURSOR-DW
DPAD-LEFT CURSOR-LEFT
DPAD-RIGHT CURSOR-RIGHT
A A
X C
- -
L P
R L
L2 R
R2 U

If you press [SELECT] you could make a combo with other buttons:

JOY BUTTON ON CPC WRITES
SELECT+B CAT
SELECT+Y |CPM
SELECT+A RUN"DISK & RUN"DISC
SELECT+X |TAPE & RUN"
SELECT+START SHOW VIRTUAL-KEYBOARD
SELECT+DPAD-UP [1], [Y]
SELECT+DPAD-DOWN [2], [N]
SELECT+DPAD-RIGHT [3], [R]
SELECT+DPAD-LEFT [4], [S]
- -
SELECT+L -
SELECT+R -
SELECT+L2 -
SELECT+R2 -
SELECT+L3 -
SELECT+R3 CHANGE JOY CFG

I tried to configure the most universal keys, Suggestions are welcomed!!

2xtime commented 5 years ago

Wow, you read my mind ! I was about to ask you if there was a way to map the Space bar to a joypad button that some games use.

I'm not able to check at the moment but when you bring up the on-screen keyboard do we still need to press Select before we can move the pointer ? Not sure why we have to do that.

2xtime commented 5 years ago

At the moment in the controls menu all you can do is change the joypad buttons to different joypad buttons ? Not really sure what the use of that is ? :smile: , I couldn't actually map anything to them, like Space to the B button.

DSkywalk commented 5 years ago

@2xtime change device-type to Amstrad Keyboard (press backspace and enter again) and you can see:

http://i.imgur.com/B0zRTNF.png

2xtime commented 5 years ago

I couldn't seem to do that on the mobile device i'm using - gpd-xd-black-16g-2

If I select 'Amstrad Keyboard' for User 1 Device Type, I can still only select joypad buttons.

screenshot_2019-02-11-21-12-59 screenshot_2019-02-11-21-12-45

DSkywalk commented 5 years ago

@2xtime maybe this feature is not available on android yet??? please, could you ask to the main project devs?

anyway, please keep the topic.

2xtime commented 5 years ago

I tried plugging in a mini-keyboard to my device and set the User 1 Type to 'Amstrad Keyboard' but it still didn't work, when closing content and re-opening the Controls menu it's gone back to 'Amstrad Joystick'.

On the C64 Core (Vice64) they have added the ability to map controller buttons to keyboard keys on a per-game basis. It's in the Core Options menu -

screenshot_2019-02-12-17-51-49

I'll just have to wait for your presets.

DSkywalk commented 5 years ago

I could develop a keyb-mapping in [options], but I think vice has an old implementation. Now you have the ability to map controllers using [controls] menu. I dont know why you cant see it in android devices :disappointed:

Maybe @fr500 could help us :+1:

2xtime commented 5 years ago

I managed to get the keyboard mapping working by setting Amstrad Keyboard, saving a Core Remap file then Resetting, but by doing this you can't use the actual joystick and the on-screen keyboard doesn't work. So you can either play games by mapping keyboard keys to the joypad or use the Amstrad joystick. You can't use the Amstrad joystick and have some keyboard keys mapped to other buttons.

DSkywalk commented 5 years ago

changes applied and new keyboard layout added to readme.md

imagen

2xtime commented 5 years ago

I have a few problems with the new update. I'm on commit 02f2c06.

I can't access the on-screen keyboard, if I hold Select and press Start it just prints 'f'.

The autostart feature no longer works, even if it's a command in an .m3u file.

I haven't managed to run a game yet. Sorry.

DSkywalk commented 5 years ago

The autostart feature no longer works, even if it's a command in an .m3u file.

@2xtime i missed the autorun code (it was a really big commit), now is fixed!! :+1:

I can't access the on-screen keyboard, if I hold Select and press Start it just prints 'f'.

Works for me on my android device :suspect:

Thanks for your help :1st_place_medal:

2xtime commented 5 years ago

I haven't updated yet, I'll probably try tomorrow.

All the [select] combo buttons work except the on-screen keyboard ? If I press [start] on it's own it prints 'j', and [select]+[start] prints 'j'.

2xtime commented 5 years ago

I updated again and now the keyboard comes up ! No idea why it didn't work before ?

Great job on the presets ! Now that the autorun works again I may not even need the keyboard. Thanks. Feel free to close this thread. :smile: