Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

I-PAC 2 and VICE c64 Keymap problems e.g. F12 #VICE



  • Hi everyone,

    I have currently setup a Raspberry 2 B+ model, with Retropi version:
    https://github.com/RetroPie/RetroPie-Setup/commit/d49b98630c58bf6dec826d0973d2a995bfea17b8
    in combination with an I-PAC 2 and sometimes a USB keyboard.

    Now before I want to build my arcade machine I make sure I only use the available I-PAC keys (see image). For the retroarch (NES, SNES, GBC,etc) emulators it was peanuts :). For my nostalgia it was a bit harder beceause I played a lot of DOS games so I needed to create a keymap per game. Now for my dad's nostalgia I am trying to make it work for the C64 Vice emulator.

    I figured out how to map the keyboard keys to 2 controllers (image) but I think there is no way around the F12 button, Backspace button, F1 button and F5 button (and maybe more but i'm fine with these for now). The thing is they are not available on the I-PAC 2 so i need to map them to other keys and I can not find a way to do this.

    So far my research goes:

    • You can map almost any key to any joystick controllers
    • There was someone who made it work through sdl-vicerc
    • Don't try you get an headdache
    • Try to use the symbolic and positional keymap but don't understand what is going on and can't find no documentation.

    So, is there anyone who knows how I can map the "p"-key to the "F12"-key?

    Forum readings:
    https://retropie.org.uk/forum/topic/5125/vice-keymap-problems -> Dead end (but a long time ago so who knows)
    https://retropie.org.uk/forum/topic/15758/a-guide-to-setting-up-vice-controls-with-an-ipac-or-other-keyboard-encoder (doesn't work)
    https://retropie.org.uk/forum/topic/9027/connecting-old-ipac-keyboard-mode/11 (different problem)

    Thanks in advance.

    IPAC_Setup



  • @Bram279b

    Hi,

    I wrote the guide that you have linked to above, I have broadly the same setup and it worked for me. To map F12 (enter Vice GUI) to a button I did the following:-

    • Navigate (using winSCP or similar) to opt/retropie/configs/c64
    • Open the file named sdl-vicerc
    • The second line of text says "MenuKey=293" 293 is the SDL key code for "F12". In order to set up the key for opening the gui just replace 293 with the appropriate SDL Key code that is mapped to your IPAC/encoder. I think the SDL keycode for “p” is 112.

    Does that work?



  • @tuki_cat said in I-PAC 2 and VICE c64 Keymap problems e.g. F12 #VICE:

    using winSCP or similar) to opt/retropie/configs/c64
    Open the file named sdl-vicerc
    The second line of text says "MenuKey=293" 293 is the SDL key code for "F12". In order to set up the key for opening the gui just replace 293 with the appropriate SDL Key code that is mapped to your IPAC/encoder. I think the SDL keycode for “p” is 112.

    Hi,

    I opened the file from the retropie with the 'nano' text editor. And see the following:

    sdl_vicerc

    I tried to just add MenuKey=293 at the second line but that didn't work, well it worked but not when I changed it to 112 (the P file). Although btw I was very glad I found your post because it was exactly what i was looking for :).



  • @Bram279b

    When I’m back later I’ll post the contents of my file on here, that may help



  • @tuki_cat Let's hope so, I will try to see if the file is being used at all by changing the window with etc. :_



  • @Bram279b

    Hi, here is the contents of my sdl-vicerc

    https://pastebin.com/4fL5udQb

    I hope it helps



  • Hi

    And thanks for al the effort but I just removed the file and it's all fine. I would expect that it would not run or created a new one but everything is working as it should be and there is no sdl-vicerc.

    So my thoughst are:

    1. It is placed somewhere else, but where?
    2. The file will only be used when it's there, but why isn't it working?
    3. I must somehow tell Vice c64 to use that file, but how?

    I saw a post:
    https://www.reddit.com/r/RetroPie/comments/4555w4/c64_emulation_station/
    Which stated it was pointing to the wrong location, although i don't see any difference. Plan for now is update everything, try to install Vice c64 again and see if it will create a new sdl-vicerc file.

    If you have any idea let me know :),

    Cheers



  • Hi,

    I updated everything and reinstalled Vice, after that the file was back and with the menukey options :D! Don't know why it wasn't correct in the first place but it works as a charm now! Thanks for your help and time.

    Cheers



  • @tuki_cat

    Hi,

    Do you know how to map the F1 key to the "1", I think you need to do that in a keymapfile which is only visible of you save that file? Does it automatically uses that file when it's there, or do I need to load it everytime?



  • @Bram279b

    Glad you got it working.

    Mapping C64 keyboard keys to your IPAC buttons

    This can be done by opening the virtual keyboard, moving to the key you want to map and then pressing the "m" key on the USB/wireless keyboard (you can also map this key in the same way you map the F12 GUI one) then click the button you want to map.

    I think there is then an option in the Vice GUI to save the key map.

    What I haven't yet managed to work out is how to save these on an 'per game' basis, so you can set up key maps per game.



  • @tuki_cat

    And thanks again, I succesfully mapped the 1 to F1, 2 to F3 and 5 to F5. Although it required some steps.

    First I mapped (as you told above) with the virtual keyboard the correct keys, and then saved it. After restarting the Vice emulator the keys weren't mapped anymore. When I loaded the keymap again the keys still didn't work. Then I thought maybe I can add the changed keys in the dsl-vicerc file (a bit like the F12 file) but then more like this "49 0 4 9" which is 1 to F1. That didn't work but I noticed that it would load the keymap according thje dsl-vicerc file, but somehow that didn't work.

    Looking in the vice.log file I noticed that it says: Loading keymap `/opt/retropie/emulators/vice/lib/vice/C64/sdl_sym.vkm'
    Now I wen to that file changed it according to the saved keymap and it works. Strange thing is that is doesn't look at the keymap it should load.

    And what I did for the Dosbox is create .sh file. Not sure if it works for C64 but you can try this e.g:

    roms\c64\frogger.sh

    sc c64/frogger/keymap.vkm /opt/retropie/emulators/vice/lib/vice/C64/sdl_sym.vkm
    load frogger\frogger.crt
    

    The problem is I don't know if there is a command to go from the .sh file to the crt/tap/etc file. Don't think 'load' wil do the trick haha.



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.