randyrossi / bmc64

A bare metal Commodore 64 emulator for the Raspberry Pi with true 50hz/60hz smooth scrolling, low input latency and better audio/video sync.
GNU General Public License v3.0
479 stars 56 forks source link

Plus4Emu: match VICE Plus4 GPIO keyboard bindings #128

Open SvOlli opened 4 years ago

SvOlli commented 4 years ago

now each key pressed on the GPIO C64 keyboard is the same on plus4 and plus4emu emulators.

I could only test that it works as intended, but I've got no idea on how to check for side effects, like a USB keyboard configuration.

K-rnivoro commented 2 years ago

Do not forget Commodore 16. The connector is the same than C64 but the pinout is completely different. Actually there are two things for improving BMC64: 1) Using the C64 keyboard emulating Plus/4, for that, only need to build a new .vkm file. 2) Using a real C16 or Plus/4 Keyboard. For that you need to add that option to BMC64, and create the corresponding .vkm for C64 emulation. I have donde that but using an Arduino Board interfase to USB: www.keymmodore.com

C64 Keyboard mapped as C16 and Plus/4: C64 keyboard mapped as C61-Plus4

C16 Keyboard mapped as C64 and Vic-20 C16 Keyboard mapped as C64-Vic-20

SvOlli commented 2 years ago

This is what this pull request is about: you can use the GPIO keyboard adapter for the BMC64 with a C64 keyboard. All the keys are mapped correctly by position, so you can use a replacement kernel with C64 keybindings and then use the C16/Plus4 emulation with C64 keys, so the layout printed on the keys matches. This was already implemented for the VICE Plus4 emulation. But as the Plus4Emu is much better, I implemented that correction also there.

@randyrossi : I still hope that this patch gets included in upstream as well, so I don't have to build my own variant, as I already was thinking about hacking up a binary patcher... ;-)

rhester72 commented 1 year ago

@SvOlli - What is your confidence level on the offsets? Having applied this patch, it sort of works.

The first row is definitely correct - back arrow, plus,/cross minus/dash, pound, and CLR/HOME work as expected.

The second row is interesting - what should be @ (which isn't supposed to be remapped at all!) is now up-arrow (not cursor, the literal arrow pointing up), asterisk is equals, and up arrow is asterisk.

Third row, equals is mapped to cursor-right.

Fourth row, cursor-down is mapped to @, and cursor-right is mapped to cursor-down.

My kernal ROMs are confirmed correct via md5sum:

32a07d19307eb226c7befd57edb7049f  kernal.318004-05-kbd64.bin
720622eb6a5d4b5df913c465959aba64  kernal.318005-05-kbd64.bin
32a07d19307eb226c7befd57edb7049f  p4kernal.rom
720622eb6a5d4b5df913c465959aba64  p4_ntsc.rom`

Any suggestions?