libretro / vice-libretro

Versatile Commodore 8-bit Emulator
GNU General Public License v2.0
40 stars 70 forks source link

Feature Request #7

Closed KMFDManic closed 5 years ago

KMFDManic commented 7 years ago

I am not exactly sure how much work would need to go into it. But, I have been porting over the Cores for the NES Classic, and sharing them with others on Reddit & YouTube. I recently got the Excellent Vice going for it. But, unfortunately, due to being in an environment without a true dedicated keyboard, Keybinding+Mapping is something that makes things a little harder to play certain games. Yes, we can pull up the keyboard with the shortcut. But, for example, in a game like Turrican, where you can use the space bar for a special attack...there is no way to map the space bar to the keyboard. It would mean a great deal to me, as well as many others, if (of course, if it isn't too much trouble!) to have a Core option to offer mapping for all keyboard keys. Many, many games are still highly playable, and I absolutely love the Core! So, again, this is only something I am requesting, politely, if it isn't going to be too much work involved! Thanks!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/48851338-feature-request?utm_campaign=plugin&utm_content=tracker%2F56502529&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F56502529&utm_medium=issues&utm_source=github).
r-type commented 7 years ago

Yes it can be something to look at.

KMFDManic commented 7 years ago

I take it you are an Irem - R-Type Fan? Or, is it associated with something else:) Thanks for looking into it. Many will be happy!

r-type commented 7 years ago

can say more retro fan that only r-type fan ... BTW I can't look at this issue until next week .

KMFDManic commented 7 years ago

Take your time! I have plenty to work on til then! I actually ripped and showcased R-Type Delta in one of my YouTube Videos. We only have about 381.6 of working Flash Memory on the NES Classic. Of that, some memory is dedicated to the Flashing Process and can't be touched. Other partition is devoted to the Factory Data. With Libretro Cores installed, etc, this leaves roughly 300 Mb of working space. So, I pretty much worked on means of Ripping and Compressing them for usage in such a limited space environment. R-Type Delta I have running at a nice 95.5Mb Ripped & Compressed. Even C64 Games, I have running via 7zip Compression! Thanks to your. and anyone else involved, work on Vice, you have helped many enjoy Commodore 64 Games on the NES Classic, as well as other Systems! Thanks again for offering to look into things! It means a lot!

modeler commented 7 years ago

This would be a great addition. I hit a similar problem with the Android build running on an Amazon Fire TV Stick (yes, it does 50 FPS with FastSID) and the experience very good, apart from being unable to use keys:

http://www.tootill.co.uk/blog/2017/04/how-to-play-commodore-64-games-on-an-amazon-fire-tv-stick/

r-type commented 7 years ago

Trying to start to add this feature . need to change to vice joystick in RA control option. BTW not tested for now (can't access a joy)

https://pastebin.com/ysR034Pn

KMFDManic commented 7 years ago

Thanks for looking into this. With the non-keyboard environments, Cores, such as the ones that run Commodore 64, CPC Amstrad, ZX Spectrum, DOSBOX, are limited in how much you can truly do, without having to address the non-keyboard factor. DOSBOX, you can use keybinds and map to any keyboard button. But, I am more likely to run ZX Spectrum, Commodore 64, CPC Amstrad, due to their ability to handle 7zip compressed games:) Thanks again, the code is looking quite good! I know once you commit it and it is compiled, it should be just what all of us non-keyboard users need:)

KMFDManic commented 7 years ago

If you go about 2:45 in, on my video for DOSBOX, you will see how I map the different keyboard buttons using DOSBOX Core. Remember, I am running this on an NES Classic.

https://www.youtube.com/watch?v=BHIsPCx0F5s&t=330s

And, here is the video of me running Commodore 64 (Vice), also on the NES Classic.

https://www.youtube.com/watch?v=cjAstc7NXfA

I have been personally working with every single possible Core, and doing my best to get the most optimal experience out of them. I have gotten dozens others going on the NES Classic, and am very thankful for the hard work you and others have put into the Core Updates!

I also had to take into account having only 381.6 Mb of Flash Memory to work with. So, compression techniques were absolutely necessary to pull many things off. This is especially the case when wanting to run Playstation 1, Turbografx-CD, Sega Saturn, Sega CD Games! But, I got all of these figured out, as well:)

r-type commented 6 years ago

https://github.com/libretro/vice-libretro/commit/3ef72efaa47be9959546c72a0f3a751fdb0810ba

@fr500 adding a generic keymapper to retroarch , so with this commit is not necessary. and binding could be done using RA GUI.

KMFDManic commented 6 years ago

Again, thanks for your efforts with this. This is something that would be incredibly useful for other Cores that were originally dependent on keyboard usage. I will definitely use this as a stepping stone to help get DOSBOX & ZX Spectrum Updaters to potentially follow suit.

r-type commented 6 years ago

As stated @fr500 , this need time to work on it and to be released , but after it will a very useful and cool feature.

KMFDManic commented 6 years ago

Of course it will! And, I am in no rush. I know first-hand how much work is required to work on this sort of thing. I juggle many projects myself. And, we all have personal lives to attend to! But, I am certainly glad you see it as a useful and cool feature that many will enjoy!

andres-asm commented 6 years ago

I have it "working" now, the constraint is the input device has to be RETRO_DEVICE_KEYBOARD or a subclass of it.

I still dunno if it will work with the cores that use RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK but I'll figure a way. I'm currently testing with bluemsx.

The mapper is working but it still needs all the GUI stuff implemented which is kinda hard for me :p might take a while.

andres-asm commented 6 years ago

@r-type if you have time, give this a shot: https://github.com/fr500/RetroArch/tree/remap-redux

The map is hardcoded in input_mapper.c so far. I'll start working on the GUI tomorrow All that you need to do in the core is to add a keyboard device with no gamepad bindings, and then it should react to such bindings.

r-type commented 6 years ago

ok thanks i will take a look

andres-asm commented 6 years ago

now it can save and load remaps from file, but there isn't a gui yet so it's still quite obnoxious to use :p For instance in bluemsx (from master) you could use this rmp file


input_player1_key_b = "110"
input_player1_key_y = "32"
input_player1_key_select = "282"
input_player1_key_start = "13"
input_player1_key_up = "273"
input_player1_key_down = "274"
input_player1_key_left = "276"
input_player1_key_right = "275"
input_player1_key_a = "282"
input_player1_key_x = "283"
input_player1_key_l = "284"
input_player1_key_r = "285"
input_player1_key_l2 = "286"
input_player1_key_r2 = "287"
input_player1_key_l3 = "288"
input_player1_key_r3 = "289"
input_libretro_device_p1 = "3"
KMFDManic commented 6 years ago

I got the joypad try 1 commit compiled. But, unfortunately, I will not be able to personally test it til tomorrow. I will followup the moment I get to test it out, as well as any other followup changes you commit. Thanks again @r-type @fr500 and @twinaphex

andres-asm commented 6 years ago

Almost there

screenshot 2017-09-10 00 51 56

KMFDManic commented 6 years ago

Fantastic! Truly solid work.

r-type commented 6 years ago

Nice !

BTW I tried it with vice on wiiu but remap file not working , seem all the remap give unknown in the GUI (like input_libretro_device_p1 = "3" that give unknown too) . i tried also with "Vice Keyboard" which is a subclass of retrokb but same. I think the issue is specific to the wiiu.

Can't test further as I my ps3 pad is not completely broken and don't react very well with RA 1.67 linux.

r-type commented 6 years ago

@KMFDManic i tested also the last commit on wiiU and was able to use space (I bind it to R3) in turrican2.

andres-asm commented 6 years ago

@r-type unknown or unmapped? the GUI wasn't ready, it lacked left / right callbacks, and it was disabled by default.

try again! It will give you unmapped by default (always) and then you can set the keys in any way you see fit.

The idea is you can provide a default keyboard map internally based on RETRO_DEVICE_JOYPAD, but if you set it to RETRO_DEVICE_KEYBOARD (or a subclass) it should not respond to gamepads at all and use the RA keymapper instead.

Maybe in the future we'll be able to get an env callback to provide a default keymap from the core to the keymapper.

KMFDManic commented 6 years ago

Tested it with Turrican on the NES Classic. Great design choice, and keybinds work flawlessly. Many, many people will be very happy! I will credit you both in the readme file I include with the Core I compiled and post for the NES Classic Community!

Thanks again, @r-type and @fr500 , you guys are truly awesome for taking time out of your days to make this happen! I am ecstatic to now be able to truly enjoy my C64 Collection! Sadly, back in the day, when the real C64 was out...I asked for it for Xmas. And, I did not get it! I even had a friend at school make me a bunch of floppies, including Dragon's Lair!, which was one game I really really loved. Unfortunately, I got an Adam Computer, instead! I am now grateful, to be able to enjoy what I never got to, when I was a kid! I did like the Adam Computer, for what it's worth! But, having C64 Emulation, rocks! Thanks again, guys!

andres-asm commented 6 years ago

Woot, how did you test? did you build yourself? this is still not on master.

KMFDManic commented 6 years ago

I used the Master that has: the commit from Yesterday,

add joykey binding try 1 - Commit 3ef72ef

Being on an NES Classic Environment, things function quite a bit differently than on retropie. But, that commit, alone, did the trick! I will test out any other enhancements you merge into the Master!

I just need to give special thanks to you in the readme! And, I will post it, and then switch it out with the next revision, when done:) But, it rocks!, plain and simple! No needing to pull up keyboard (on Turrican, of course), tap space bar, then put away keyboard! Now, just a simple tap of a button, and everything is great.

KMFDManic commented 6 years ago

My readme is as follows. I always like to credit anyone who does a service to the Community! If I missed anyone else who has helped do commits on the great Vice Core, be sure to let me know!

=== Vice x64 core for RetroArch ===

This module will add support for Commodore 64 to RetroArch

Available executables and arguments:

Core by libretro Template by pcm/Compiled & Updated by KMFDManic Vice libretro commits by r-type and fr500 Hakchi module system by madmonkey NES Mini shell integration by Cluster (c) 2016-2017

andres-asm commented 6 years ago

Ah then you're not using my mapper, you're using the VICE mapper. Mine is supposed to replace all the other mappers by simply providing one solution for all the cores.

@r-type does this core use polling or the SET_KEYBOARD callback?

KMFDManic commented 6 years ago

I know this:) But, it is a start, and works for the time being! I am excited to be able to use your mapper, once it commits to the master! It is like going from vanilla to chocolate, then waiting for the chocolate fudge as the next logical step!

r-type commented 6 years ago

@fr500 it's unknown , I use a remap files and choose vice keyboard (keyboard subclass). with no remap file i was not able to change the key in control from GUI. this core (vice) use poling and not the keyboard cb. but i only tested with vice on wiiu.

for the last commit , it provide core remap inspired of what you do with dosbox core. And yes your works will be a better solution as it will be compatible with all core without to implement remap on each core.

KMFDManic commented 6 years ago

Thanks again, @r-type and @fr500 , even the first commit was all I really needed to pull the magic off, for keybind support:) People are very happy with the results! I am happy with the results! Ask, and you shall receive:) Thanks again!

andres-asm commented 6 years ago

@r-type if you're ok with it, I can try to hookup everything for the new mapper this weekend.

r-type commented 6 years ago

@fr500 ,nice and yes I'm ok , but i also want to know because the list of core that will benefit of this feature is long .

vice/atari800/hatari/cap32/puae /mame ....

KMFDManic commented 6 years ago

End result of the feature request, thus far. Thanks so much!

https://youtu.be/dBn9MkHUA_E

andres-asm commented 6 years ago

@r-type it's on master now. The only thing you need to do is add one RETRO_DEVICE_KEYBOARD device and then it should work automatically

As for guidelines.... I recommend not listening to any RETRO_DEVICE_JOYPAD input when RETRO_DEVICE_KEYBOARD is enabled. You can always listen to keyboard in RETRO_DEVICE_JOYPAD if you want to have an internal mapper anyhow.

Let me know if you have any issues.

I plan to add multiple gamepad support soon!

andres-asm commented 6 years ago

Edit: ah! I just realized I had offered to hook it up myself, well this weekend was bad for me so I didn't remember, maybe the next one.

r-type commented 6 years ago

Hi ,

i tried yesterday to implement it in vice (linux) seem to works. but in the controls menu, the name of joypad button to bind not appear (ho my poor English) i have number instead like (2 +9 -9 10 ...). i must doing something bad.

As for wiiU like said in the RA thread , it's not working. (edit @ploggy nevermind just receive my reset password request)

r-type commented 6 years ago

in makefile for wiiu

GRIFFIN_BUILD = 0

so not sure if your DEFINES += ... -DHAVE_KEYMAPPER

is catch as it's in a ifeq ($(GRIFFIN_BUILD), 1)

KMFDManic commented 5 years ago

@r-type @fr500 Legacy Issue for me. But, thank you both so very much for helping out back when I first brought this request up. Things have become incredibly awesome on the Mini Classics, due to the addition of the keyboard to controller mapping:)